473,666 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session varaibles are lost when an error occurs

So
In VS2003, when debugging (with breakpoints set) a ASP.net web project
(locally), if an error/exception occurs the browser navigates to the "Server
Error" page. After this point it looses all the values stored in the Session
objects, and leads to many other errors, before I must refresh the page and
restart all over again. What the problem can be?

Thanks in advance.
Nov 19 '05 #1
1 1106
Hi,

Before redirecting to the error page the current session is distroyed and a
new session is created. This is the ASP.NET behavior. What you can do is to
catch all unhandled exceptions in the Application_Err or from Global file. In
this handler you should clean the error and manually redirect to your custom
error page using Server.Transfer method. This way you prevent the
application from distroying the session.

"So" <.> wrote in message news:O3******** ******@TK2MSFTN GP09.phx.gbl...
In VS2003, when debugging (with breakpoints set) a ASP.net web project
(locally), if an error/exception occurs the browser navigates to the "Server Error" page. After this point it looses all the values stored in the Session objects, and leads to many other errors, before I must refresh the page and restart all over again. What the problem can be?

Thanks in advance.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1941
by: Jim | last post by:
Hi, I am using forms based authentication for my website. Whilst testing I have noticed that occasionaly it appears that the Context.User.Identity.Name is valid however the session variables that I have created as the website is used have been lost. I think it is something to do with the session timeout. I thought when the session times out (session varaibles lost) the user context is cleared as well - or is this an incorrect...
2
2434
by: Daflookie | last post by:
For one reason or another I am unable to access Session contents in my asp.net application via the global.asax's Application_Error event. I can pull this exact code snippet below out of global.asax and place it in a normal page (or class file that doesn't inherit from system.web.ui.page) and things work fine: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim currentContext As System.Web.HttpContext =...
13
3053
by: SAL | last post by:
Okay, don't bash me to hard for my design on this app, it's my first web app and it's in production. My basic design is using Datatables created via the designer with a business logic class in between the datatable and ObjectDataSources. In one page I had a Gridview with select enabled. When an row in the grid is selected, I retrieve the SelectedValue, store the value in a Session variable and redirect the response to another web page,...
0
914
by: hdsllc | last post by:
I have an ASP.NET 2.0 app where I have the following scenario: 1. Set a session variable in page A. 2. From page A, click a link to navigate to page B (session variable needed in page B). 3. Click refresh button on toolbar in page B. Error occurs because session variable has been lost. This occurs in VS 2005 dev environment (VS web server) or production server. The sessionState section of my web.config is as follows - <sessionState
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8355
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.