Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 08, 2012 02:55 PM by mcupryk
Aug 07, 2012 08:21 PM|LINK
I need to be able to store the orderid in when the usercontrol defines
I am just wondering if there is an example some can show me.
I would like to be able to retreive it on any page.
This would be of great help.
Aug 07, 2012 08:28 PM|LINK
If you need to save it on one page and use it on another, I think Session would be the way to go.
Aug 07, 2012 10:22 PM|LINK
If you want the value to be persisted between pages, then session is the right direction.
You can save in a HiddenField but that will be only accessible on the particular page where that is define.. So use a Session varible..
//To Save a Value in a session
Session["Id"] = yourValue ; // Lets say its a string
//To access the Session variable use this
String id = string.Empty ;
If(Session["Id"] != null)
id = Session["Id"] As string ;
Aug 08, 2012 12:42 PM|LINK
The only problem is how do I set the session to not time out.
Aug 08, 2012 01:29 PM|LINK
You want your session to time out. If it never timed out, your users' informatin would sit in RAM on the server forever until the server ran out of room in memory. I think the default timeout is 10 minutes. Do you have a need for your users to be on your
site without any activity for over 10 minutes? Each time they request or refresh a page, the 10 minute timer is reset. If so, how long do you want to keep thier session alive before assuming they are not coming back and clearing out the server memory?
Aug 08, 2012 02:55 PM|LINK
ok that sounds good if the session var is null goto expire page.