Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ViewState not working for runtime web controls on postback

Reply
Thread Tools

ViewState not working for runtime web controls on postback

 
 
=?Utf-8?B?TWVyZGFhZA==?=
Guest
Posts: n/a
 
      10-29-2006
Hi,
I am using ASP.NET 2.0 with C#.
On a page I have a few (static) textboxes that get populated from database
and then I create other textboxes during runtime using the folloiwng steps:
1. I add a TableRow(TR) to an existing table using HtmlTableRow
2. I add TableCells(TD) to the above TR using HtmlTableCell
3. I add TextBoxes to the TDs using using TextBox

Then I start entering into the runtime Textboxes, when done, I press Enter
which does a postback. Now I am back at the page and my first list of static
textboxes are still there while the runtime textboxes and the TR and TDs are
gone. If I try to recreate the TRs with the same name as before, I get an
invalid ID meaning that the TR is still on the form. I just don't see it.

How would I presere the runtime web controls upon postback? How would I see
them?

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusion Over Postback, ViewState and Dynamically Added Controls =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?= ASP .Net 1 05-03-2005 12:02 AM
ViewState of Child Controls Not Working Mystery??? Earl Teigrob ASP .Net Web Controls 3 10-08-2004 11:02 PM
Dynamic runtime controls, postbacks, Page_Init, Viewstate et al Chuck Ritzke ASP .Net 4 08-06-2004 06:05 PM
Viewstate errors... how do I get viewstate working? mark ASP .Net Building Controls 0 02-20-2004 02:17 PM
ViewState in Runtime user controls shail ASP .Net 0 08-30-2003 12:06 PM



Advertisments