Last post Oct 26, 2006 08:15 PM by mbanavige
Oct 26, 2006 05:19 PM|joef|LINK
Private Sub Global_AcquireRequestState(ByVal sender
ByVal e As System.EventArgs)
'real code goes here
I just converted a web app from VS2003 to VS2005 and ran into some issues on a few of my pages. Oddly, it does not occur on all of them.
In 2003, when I click a link button on my menu
AcquireRequestState fires twice - once for the postback and once for the re-direct. This is normal and expected.
In 2005, when I click the same link button,
AcquireRequestState fires 3 times. And the 3rd time
HttpContext.Current.Session Is Nothing. Needless to say, this broke a lot of code.
I Googled this problem and have seen a coupld of other cases where the Session just disappeared. But there were no good answers to the issue.
The workaround I coded above is just that - a hack.
Can someone explain:
1. Why it fires 3 times instead of twice?
2. Why is Session Nothing? Shouldn't it always exist by this point? It does exist the first 2 times it is hit - why not the 3rd?
Oct 26, 2006 05:59 PM|mbanavige|LINK
for the instance where session is nothing, is the page being requested perhaps webresource.axd?
this request could be made for a number of reasons - one such reason is as having validators on your page
Oct 26, 2006 07:44 PM|joef|LINK
I do not have validators on this page (or the other one that is having this problem.)
They are "standard" data entry screens with text boxes and dropdowns.
How would I check for webresource.axd being "called"?
Oct 26, 2006 08:15 PM|mbanavige|LINK
just view source on the rendered page and search for webresource.axd