
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