shootsnlad Posted March 20, 2006 Posted March 20, 2006 Ok, I have a session variable called "CheckType". I have it in my global.aspx blanked out: Session("CheckType") = "" I then have a page where I assign a value to it: Session("CheckType") = "DIRECT" I then do a Response.redirect onto another page. Then I try to reference the value of the session variable: If Session("CheckType") = "DIRECT" then..... It is always blank. Should I not have it in global.aspx? Quote
Mister E Posted March 21, 2006 Posted March 21, 2006 Where in the global.asax are you setting the value to blank? Make sure it is not being overwritten with every page load. Put a breakpoint on the Response.Redirect and check the contents of the Session variable right before you actually redirect. Quote
cyclonebri Posted March 27, 2006 Posted March 27, 2006 Ok, I have a session variable called "CheckType". I have it in my global.aspx blanked out: Session("CheckType") = "" I then have a page where I assign a value to it: Session("CheckType") = "DIRECT" I then do a Response.redirect onto another page. Then I try to reference the value of the session variable: If Session("CheckType") = "DIRECT" then..... It is always blank. Should I not have it in global.aspx? Take it out of your global.asax. I think you are confusing application variables with session variables. A session variable, a cache variable, and a viewstate variable can be assigned or called from within any page in your application, just make sure you are using the correct one for what you are trying to accomplish. Also, if you are still having problems with your session variable, make sure your settings are correct in your web.config file and that you aren't timing out. Good Luck, Brian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.