Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modifying Page ViewState in a Method
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00946814
Message ID:
00947127
Vues:
15
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform