View Single Post
  #3 (permalink)  
Old May 19th, 2004, 10:43 AM
jlarouche jlarouche is offline
Registered User
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Better way for doing this is using the ViewState bag. Almost the same than using Session, except that ViewState are'nt taking server memory.

Best practice is : Save small common object type into ViewState (Ie, string,int,datetime) and save Huge objects (XmlDocument,Dictionary,etc..) into the Session bag.

PS: ViewState value will only longs while you are posting back a page, Session will last as long the session is alive.


========================
Using ViewState bag :
At the Page_PreRender event, Save the String into the ViewState :
ViewState("viewstateKey") = WorkExperience

At Page_Load get the previously ViewStateValue
WorkExperience = ViewState("viewstateKey")
=========================
Jonathan
jlarouche@dev-id.com

Reply With Quote