Solved

ASP.NET DEVELOPMENT DEBUGGING MODE - Random crash

Posted on 2012-04-10
4
193 Views
Last Modified: 2012-04-18
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
0
Comment
  • 2
4 Comments
 
LVL 33

Expert Comment

by:paulmacd
ID: 37827578
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.
0
 

Author Comment

by:Axiom_Consulting_Developer
ID: 37827718
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 ?
0
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
ID: 37860596
Sorry, I thought I'd replied to this.

Yes, changing the codebehind - in debug mode or otherwise - can reset the session, requiring a new session to be instantiated.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now