Solved

ASP.NET DEVELOPMENT DEBUGGING MODE - Random crash

Posted on 2012-04-10
4
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

749 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