This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C1EACC.844AB100
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
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
Category
Message
From First(s)
From Last(s)
aspx.page
Begin Init
aspx.page
End Init
0.000503
0.000503
aspx.page
Begin LoadViewState
0.000719
0.000216
Unhandled Execution Error
Specified cast is not valid.
at System.Web.UI.WebControls.WebControl.LoadViewState(Object
savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Page.LoadPageViewState()
at System.Web.UI.Page.ProcessRequestMain()