W
wardy1975
Hi all, got a bit of a strange one....I am developing in ASP.NET 2.0
and I have some code in my Session_Start method that sets user
attributes. If an error occurs at this time, such as the user is not
registered or configured for the site, I throw an error that is caught
by the Application_Error method of the global.asax file. I proceed to
get the last error information, clear it down, and then I attempt to
redirect to an error page using Response.Redirect. However, the
strange thing is that for some reason when I attempt to do this, it
results in the Session_Start being called again, which ends up putting
me in a loop as it throws the same error as before. Unfortunately I am
also integrated with CMS so using Server.Transfer is not necessarily an
option as it doesn't work right when transferring to a CMS page (which
one of our error pages is).
Has anyone ever seen this before or know why when doing a
Response.Redirect from with the Application_Error method would result
in Session_Start getting called? This type of behaviour does not occur
if the error happens anywhere else in the application or for any other
redirect that we have.
Thanks,
and I have some code in my Session_Start method that sets user
attributes. If an error occurs at this time, such as the user is not
registered or configured for the site, I throw an error that is caught
by the Application_Error method of the global.asax file. I proceed to
get the last error information, clear it down, and then I attempt to
redirect to an error page using Response.Redirect. However, the
strange thing is that for some reason when I attempt to do this, it
results in the Session_Start being called again, which ends up putting
me in a loop as it throws the same error as before. Unfortunately I am
also integrated with CMS so using Server.Transfer is not necessarily an
option as it doesn't work right when transferring to a CMS page (which
one of our error pages is).
Has anyone ever seen this before or know why when doing a
Response.Redirect from with the Application_Error method would result
in Session_Start getting called? This type of behaviour does not occur
if the error happens anywhere else in the application or for any other
redirect that we have.
Thanks,