Last post Jun 19, 2011 08:04 AM by NasimIAsl
Jun 15, 2011 03:20 PM|leo143|LINK
I create a dynamic table with controls like text boxes, drop down lists and labels. I do this in Page_Load because the number of controls I add to the table depends on some data. There is a feature on the site to delete a row from the table. When a row is
deleted, a new table is build again and placed in the parent panel control. I am having a problem with view state. When the row is deleted, the values from the top row are popping down to the text boxes and drop downlists in the next row. I have set EnableViewState
as false on the Panel control that holds the dynamic table.
Jun 15, 2011 03:58 PM|Thulasiram|LINK
I dont know your exact requirement.
If you wanna just remove that row from ui .
<input type="button" value="Delete"
Jun 15, 2011 04:30 PM|leo143|LINK
Well actually the feature on the site should not directly delete a row from the table. The feature deletes a record on a different screen and the information is saved to the database. The table has to be rebuilt and updated with the existing records in the
database. Text data is updated correctly but the Textboxes and Drop downs in the table are holding on to the previous controls view state
Jun 16, 2011 06:08 AM|GPankaj|LINK
Textboxes do not use ViewState to maintain/hold their values between postbacks. Values are maintained in HTTP Post headers.
Controls like Textbox, is inherired from
can refer this post. I think it has your answer.
Jun 19, 2011 08:04 AM|NasimIAsl|LINK
when u create or load asp controls
and u remove this the viewstate not change for this becase may be u need back
u just add style display none and one attribue for u know u deleted this row