Developer forum

Forum » Development » ArgumentNullException: Value cannot be null.

ArgumentNullException: Value cannot be null.

Gunnar Hansen
Reply
Hello everyone. I get this error (look below), when I try to run my project on my local machine. I am running the latest DW version currently available (19.2.4.1).

Please help.

regards
Gunnar

------------

Serverfejl i programmet '/'.

Value cannot be null.
Parameternavn: input

Beskrivelse: Der opstod en undtagelse, der ikke blev behandlet, under udførelse af den aktuelle webanmodning. Se staksporingen for at få yderligere oplysninger om fejlen, og hvor den kom fra i koden.

Detaljer om undtagelse: System.ArgumentNullException: Value cannot be null.
Parameternavn: input

Kildefejl:

Linje 19:             Output.Controls.Add(pvCtrl);
Linje 20:             pvCtrl.Pageview = pageview;
Linje 21:             pvCtrl.ParseControls(); Linje 22: 
Linje 23:             //Output.Text = Pageview.Output();

Kildefil: C:\Documents and Settings\user\my documents\visual studio 2010\Projects\LanRoknari\LanRoknari\Default.aspx.cs    Linje: 21

Staksporing:

[ArgumentNullException: Value cannot be null.
Parameternavn: input]
   System.Text.RegularExpressions.Regex.Replace(String input, String replacement) +5321535
   System.Text.RegularExpressions.Regex.Replace(String input, String pattern, String replacement, RegexOptions options) +47
   Dynamicweb.Frontend.PageView.Output() +995
   Dynamicweb.Frontend.PageviewControl.ParseControls() +88
   CustomModules.Default.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\user\my documents\visual studio 2010\Projects\LanRoknari\LanRoknari\Default.aspx.cs:21
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Versionsoplysninger: Microsoft .NET Framework version:2.0.50727.3623; ASP.NET version:2.0.50727.3618



Replies

 
Nicolai Høeg Pedersen
Reply
It seems like you pageview returns null...

Can I see your entire Default.aspx.cs code?
 
Gunnar Johildarson
Reply
 
     It seems like you pageview returns null...

Can I see your entire Default.aspx.cs code?
using System;
using Dynamicweb;

namespace CustomModules
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Set a timer to monitor performance
            long startTime = DateTime.Now.Ticks;
            //Initiate the pageview object that handles a Page view in Dynamicweb
            var pageview = new Dynamicweb.Frontend.PageView();

            //Load data, templates and settings in the pageview object
            pageview.Load();

            var pvCtrl = new Dynamicweb.Frontend.PageviewControl();
            Output.Controls.Add(pvCtrl);
            pvCtrl.Pageview = pageview;
            pvCtrl.ParseControls();

            //Output.Text = Pageview.Output();

            //Collect the last performance counter and print if requested
            pageview.Execution.Add("After output");
            string strDebug = Base.ChkString(Base.Request("Debug"));
            if (strDebug == "True")
            {
                Status.Text = Server.HtmlEncode("<!-- Exe time: " + Convert.ToString((DateTime.Now.Ticks - startTime) / 10000000 + " " + pageview.StatusText + " -->") + pageview.Execution.getExecutionTable() + pageview.OutputPages());
            }
            else
            {
                Status.Text = "<!-- Exe time: " + Convert.ToString((DateTime.Now.Ticks - startTime) / 10000000) + " " + pageview.StatusText + " -->";
            }
        }
    }
}
   
 
Nicolai Høeg Pedersen
Reply
That looks right.

Do you have the /Files correctly? Does the template used on the previewed page exist?

 

You must be logged in to post in the forum