Last post Sep 30, 2016 04:09 PM by paindaasp
Sep 28, 2016 03:10 PM|ali_0087|LINK
In my default.aspx, I am calling the docPage.aspx in following manner after setting up session values.
Session["docType"] = commandArgs;
Session["docName"] = commandArgs;
Session["profile"] = searchParam;
And in my docPage.aspx I retrieving the values and using accordingly. It works fine while debugging but as soon as I deploy it to local IIS the docPage.aspx is loaded with following exceptions. any resolution or suggestion would be handy.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
Default2.Page_Load(Object sender, EventArgs e) +60
System.Web.UI.Control.OnLoad(EventArgs e) +108
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4497
Sep 29, 2016 08:08 AM|Chris Zhao|LINK
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. To address this issue, make sure that the argument is not null, or handle the thrown exception in a try…catch…finally block.
Sep 30, 2016 04:09 PM|paindaasp|LINK
My guess is that one of your session variables is null where you are using it in the Page_Load event in class Default2.
Are you sure they are being set in default and do you check to ensure they are valid before using them in Default2.
Is the environment that you deploy to a server farm, or does it load balance? This could cause the session variables to be lost.