Custom Web Controls text box drops data?

J

Joel Barsotti

I'm programatically adding a textbox to a HtmlTable and then rendering that
text box in the control.

I've explicitly made enableViewState true, but whenever it performs a
postback I lose the data.
 
V

Victor Garcia Aprea [MVP]

Hi Joel,

This sounds like you're adding the child control to its container or the
table itself too late (ie. after Init or Load). For example if you add these
controls as a result of a click event they won't be able to restore its
state because viewstate loading code has already ran and your controls
weren't availabl at that time.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top