Solved

ASP.NET DEVELOPMENT DEBUGGING MODE - Random crash

Posted on 2012-04-10
4
198 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 34

Expert Comment

by:Paul MacDonald
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 34

Accepted Solution

by:
Paul MacDonald 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

777 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