Page 1 of 1
ViewState
Posted: Thu Jun 04, 2009 9:00 am
by dittohead
I need to keep view state turned on the OnePageCheckout page. I know by default that the view state is on, but something is turning it off when you get the page_init event. Does anyone have any ideas on how to keep the view state on? What is triggering view state off?
Thanks,
Dave
Re: ViewState
Posted: Thu Jun 04, 2009 9:11 am
by mazhar
OnePageCheckout control is making use of custom view state by disabling view state one many controls. What do you want to do, if you are trying to do something with ViewState data then I think it will be available after Page_InIt event.
Re: ViewState
Posted: Thu Jun 04, 2009 9:20 am
by dittohead
Thank Mazhar for your response.
I checked the page_load event and the view state is on but i noticed that there is nothing in the state bag. What happened to the item I saved to it on a previous page?
Re: ViewState
Posted: Thu Jun 04, 2009 9:24 am
by mazhar
If you want to pass something between different pages then you may make use of Session object.
Re: ViewState
Posted: Thu Jun 04, 2009 9:40 am
by dittohead
I had used the Session object before, but I ran into some problems with it so I went to view state. I will review the Session object again.
Thank You!
Re: ViewState
Posted: Thu Jun 04, 2009 10:23 am
by Logan Rhodehamel
dittohead wrote:What happened to the item I saved to it on a previous page?
On a previous (different) page or on a previous load of the one page checkout?
Re: ViewState
Posted: Thu Jun 04, 2009 11:07 am
by dittohead
On a previous (different) page.
Re: ViewState
Posted: Thu Jun 04, 2009 11:26 am
by Logan Rhodehamel
Generally, ViewState does not persist across different pages. ViewState values can only be accessed on the same page (on a postback). To maintain values across pages you either have to save in session, database, or include in a url parameter.
Re: ViewState
Posted: Thu Jun 04, 2009 11:38 am
by dittohead
Thanks Logan for your response.
I am finally getting access to the data I need.
Re: ViewState
Posted: Fri Jun 05, 2009 4:23 am
by mazhar
dittohead wrote:Thanks Logan for your response.
I am finally getting access to the data I need.
sounds good