digital_soul
asked on
Nested user controls losing Viewstate
Hi Experts
I have a user control (a drop down control) nested within another user control (a gridview) and am using Viewstate to keep track of the gridview SortDirection (ASC or DESC). This works fine, until the selected index is changed in the nested control and then that control needs to read this value from ViewState. At this point however the value is Nothing.
Is there a way of persisting Viewstate across nested user controls?
Thanks
Stewart
I have a user control (a drop down control) nested within another user control (a gridview) and am using Viewstate to keep track of the gridview SortDirection (ASC or DESC). This works fine, until the selected index is changed in the nested control and then that control needs to read this value from ViewState. At this point however the value is Nothing.
Is there a way of persisting Viewstate across nested user controls?
Thanks
Stewart
Try to use HttpContext.Current.ViewSt ate, instead of simple ViewState
ASKER
'VIewState' is not a member of System.Web.HttpContext so Visual Studio tells me.
ASKER
Would I be better off just storing this value in the Session?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.