470,648 Members | 1,317 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,648 developers. It's quick & easy.

inherits TextBox and new properties at runtime

Hi, I created a class in ap.net using vb.net that inherits from
Textbox. I added a few of my own properties and methods, set it up to
appear in the toolbox. And have used it. My properties that appear on
the toolbar work fine at design time. I set them at design time and all
works fine. I can access them later, they retain value and work.

However, when I try to set them at run time, they set but when the page
posts back, the data has reverted back the defaults. My user properties
are not retaining value during the postback. SOOOOOO the question is
how do I get my user properties to retain values during postback if set
at runtime? Thanks.

Nov 19 '05 #1
1 1195
On Wed, 13 Jul 2005 12:43:32 -0500, <ro********@csaa.com> wrote:
Hi, I created a class in ap.net using vb.net that inherits from
Textbox. I added a few of my own properties and methods, set it up to
appear in the toolbox. And have used it. My properties that appear on
the toolbar work fine at design time. I set them at design time and all
works fine. I can access them later, they retain value and work.

However, when I try to set them at run time, they set but when the page
posts back, the data has reverted back the defaults. My user properties
are not retaining value during the postback. SOOOOOO the question is
how do I get my user properties to retain values during postback if set
at runtime? Thanks.


Are you persisting the property values in ViewState? When setting them,
put them in ViewState, and also when getting the value, ask for it from
ViewState.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by CsaaGuy | last post: by
1 post views Thread by Roberto Bindini | last post: by
2 posts views Thread by avanti | last post: by
8 posts views Thread by Steve K. | last post: by
9 posts views Thread by Brian | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.