all groups > dotnet general > may 2005 >
You're in the

dotnet general

group:

viewstate-customcontrol


viewstate-customcontrol Jaisabari
5/24/2005 10:53:02 PM
dotnet general:
How to save viewstate in Custom controls
--
Regards
Re: viewstate-customcontrol Dave
5/25/2005 8:52:54 AM
The framework will automatically save and restore the ViewState for your web controls.

Here is an example of how to use the ViewState as a backing store for a public property on a custom web control:

[DefaultValue("")]
public string RoundTripString
{
get
{
return (ViewState["RoundTripString"] != null)
? (string) ViewState["RoundTripString"]
: string.Empty);
}
set
{
ViewState["RoundTripString"] = value;
}
}

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
[quoted text, click to view]

AddThis Social Bookmark Button