inherits TextBox and new properties at runtime

R

ross_smith

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.
 
C

Craig Deelsnyder

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top