Adding property to TextBox - 08-31-2010 , 03:07 PM
I have created a WebControl that inherits from TextBox. I would like to add
a property to it that stores/retrieves a ViewState value, so the value is
persisted upon postback.
As an attempt to accomplisth this, I've added a HiddenField control to the
Controls collection during CreateChildControls. At the client, I have
during LoadPostData, like so
Text = postCollection[this.UniqueID + "_HiddenFld"];
Thought there might be a better way to accomplish this though. I'm worried
that the value may not always be persisted for some reason. Is there a
better way of doing this?
Re: Adding property to TextBox - 09-21-2010 , 07:55 AM
have you tried..
reading text in the webpage, then changing it's state with an if.. else
statement.... use the text itself as the toggle flag
hope this helps.. just learned that trick the other day.. still a newbie
"Jason Barnett" <JasonBarnett (AT) discussions (DOT) microsoft.com> wrote
|Thread Tools||Search this Thread|