ViewState

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

ViewState

Post by dittohead » Thu Jun 04, 2009 9:00 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ViewState

Post by mazhar » Thu Jun 04, 2009 9:11 am

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.

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: ViewState

Post by dittohead » Thu Jun 04, 2009 9:20 am

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?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ViewState

Post by mazhar » Thu Jun 04, 2009 9:24 am

If you want to pass something between different pages then you may make use of Session object.

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: ViewState

Post by dittohead » Thu Jun 04, 2009 9:40 am

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!

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: ViewState

Post by Logan Rhodehamel » Thu Jun 04, 2009 10:23 am

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?
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: ViewState

Post by dittohead » Thu Jun 04, 2009 11:07 am

On a previous (different) page.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: ViewState

Post by Logan Rhodehamel » Thu Jun 04, 2009 11:26 am

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.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

dittohead
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jan 14, 2008 3:14 pm
Location: Dayton, Ohio

Re: ViewState

Post by dittohead » Thu Jun 04, 2009 11:38 am

Thanks Logan for your response.

I am finally getting access to the data I need.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ViewState

Post by mazhar » Fri Jun 05, 2009 4:23 am

dittohead wrote:Thanks Logan for your response.

I am finally getting access to the data I need.
sounds good

Post Reply