Link to home
Start Free TrialLog in
Avatar of Axiom_Consulting_Developer
Axiom_Consulting_Developer

asked on

ASP.NET DEVELOPMENT DEBUGGING MODE - Random crash

Developing on an Asp.Net project in visual studio, i am curious why it crashes very often in a line like this:

myPage.RegisterClientScriptBlock("AJAX_GRID_UPLOAD", "<script src='" + System.Web.HttpContext.Current.Session[SessionConstants.APPLICATION_ROOT].ToString() + "CustomControls/AjaxUpdatePanelGrid.js'></script>");

It has something to do with session expiration. For example, often when i make changes to code in aspx and hit refresh page while in debugging mode, i see my application crashing to that line of code. I would like to avoid it if possible.



Thanks
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Check to see if the session exists/persists before you run that line of code.  

It's worth pointing out that sessions expire in production as well as in development.
Avatar of Axiom_Consulting_Developer
Axiom_Consulting_Developer

ASKER

The session does expire. But shouldn't as my settings for the sessionstate in application and IIS are set too high. Why would modifying an aspx code and refreshing the browser page cause it to reset the session ?
ASKER CERTIFIED SOLUTION
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial