Posted on: 1/28/2014 5:47:19 AM | Views : 565

Hello All,
My Page_Load handler in Default.aspx:
if (!IsPostBack) { // some other code if (Session["X"] != null) { // Was trying to find out what was going on Object obj = Session["X"]; txtX.Text = obj.ToString(); } } My app is built with VS 2013 Express for Web using the "ASP.NET Web Application" template. It uses forms authentication. In the Login form, I set session variable "X" and initialise a textbox to that value in the Default form's Page_Load.
When I run the application in the debugger, if after logging out, I log in again (i.e., without ending the debug session first), then Page_Load throws an exception:
Server Error in '/' Application. Object reference not set to an instance of an object.           ...

Go to the complete details ...