asp.net - User control (ascx) and properties -
The only way to continue the property value within a user control is to use Vostate.
Public String Title {get {return Convert.ToString (ViewState ["title"]); } Set {viewstate ["title"] = value; }}
I can not say that I am really impressed with it, because more properties are more nonsense in the user control, which will paste you into the viewtest. Is a Better Way?
It depends if you need property values that remain beyond a post-back So you have to use ViewState or session. Since those controls have been rebuilt on each post, so you can not retain that status otherwise.
Comments
Post a Comment