Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modifying Page ViewState in a Method
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00946814
Message ID:
00947127
Views:
16
Found a way to do this without ( I hope :-) ) violating OOP principles. Instead of passing the Page to the method I am passing the ViewState itself and after testing this seems to work fine. The method receiving the call would look like (C#):
/***********************************************************************/
public static void MyViewStateMethod(System.Web.UI.StateBag pagViewState)
/***********************************************************************/
{
    pagViewState["MyProp"] = ...
    //  More code ...
}
and the method call would look like:
    MyModule.MyViewStateMethod(this.ViewState);
>
>Even though the ViewState collection does not show in intellisense you may want to try to access it anyway. The only reason I suggest that is that certain methods do not show in the intellisense of VB.net (ex: RegisterStartupScript) even though they are part of the page object and accessible.
>
>Hope that helps...
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform