Monday, July 13, 2009

How do you keep your session variables when you load a new ASP page?

And, not by using the query string. Any ideas?

How do you keep your session variables when you load a new ASP page?
Use hidden fields in the asp page. One hidden field for each field, the value of which you wish to retain between sessions. As the user enters values in these fields assign these values to the corresponding hidden fields. Thats how it works in asp and also in ASP.NET (only difference being its behind the scenes here).
Reply:assuming all the asp pages are on the same domain, session variables don't need to be kept when you are going from page to page, they are retained automatically when you first set them and they will be available to the whole app, that's the way they work. if you're losing sessions, try increasing the session timeout.





another way is to use cookie if querystring's not an option.


No comments:

Post a Comment