Problem with dynamically created HTML table rows 
Author Message
 Problem with dynamically created HTML table rows

Hi,

I've got a web form which users have to select a number from a drop-down
list and on postback that number of rows are inserted into a table below the
drop-down box. Each row has a couple of text boxes and the last row has a
submit button.

That all works fine, BUT.

When the button is pressed the following error comes up:

 Specified cast is not valid       (I've pasted the trace info at the bottom
of this email.)

I've tried several things, including trying to recreate the rows in the
Page_Load and Page_Init subs and I've specified EnableViewState=false on all
the rows and textboxes but I still get this error.

I've been playing with this for 3 days now and I'm sure there is something
stupid I'm missing - can anyone help?

Thanks, Matt

Trace info:

[InvalidCastException: Specified cast is not valid.]
   System.Web.UI.WebControls.WebControl.LoadViewState(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   System.Web.UI.Page.LoadPageViewState()
   System.Web.UI.Page.ProcessRequestMain() +418



Sat, 09 Oct 2004 21:05:40 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Creating HTML Table dynamically

2. Help adding Table Rows dynamically Please!

3. to add row dynamically in table

4. Add new row to a table dynamically

5. Controlling pagination within a dynamically created HTML page

6. Example of dynamically creating WithEvents vars and HTML parsing

7. Getting row/column index of HTML TABLE cell

8. Using HTML table rows collection with VBScript

9. Anyway to Clear / Delete / Remove all rows from an HTML Table

10. show/hide an html table row

11. Dynamically creating a table

12. Creating a table dynamically

 

 
Powered by phpBB® Forum Software