A
Andrew Winn
Hi,
I have created a WebControl which contains an ASP
Textbox, ASP Button, ASP Listbox and a Hidden field.
I've been using "Building ASP.NET Server Controls" by
Dale Michalk and Rob Cameron as a reference.
My code is in VB.NET
It works in my example page which has a couple of
controls and a button to post back.
But when I put it on a page which I have already created
with lot's of other controls on it I get the following
message when it post's back (it works on initial load).
I also get the same message even if I've only draged the
control onto the form without any server-side coding. If
I remove the control the Page works Ok.
Failed to load viewstate. The control tree into which
viewstate is being loaded must match the control tree
that was used to save viewstate during the previous
request. For example, when adding controls dynamically,
the controls added during a post-back must match the type
and position of the controls added during the initial
request
Can anybody give me an advice about this?
Regards,
Andrew
I have created a WebControl which contains an ASP
Textbox, ASP Button, ASP Listbox and a Hidden field.
I've been using "Building ASP.NET Server Controls" by
Dale Michalk and Rob Cameron as a reference.
My code is in VB.NET
It works in my example page which has a couple of
controls and a button to post back.
But when I put it on a page which I have already created
with lot's of other controls on it I get the following
message when it post's back (it works on initial load).
I also get the same message even if I've only draged the
control onto the form without any server-side coding. If
I remove the control the Page works Ok.
Failed to load viewstate. The control tree into which
viewstate is being loaded must match the control tree
that was used to save viewstate during the previous
request. For example, when adding controls dynamically,
the controls added during a post-back must match the type
and position of the controls added during the initial
request
Can anybody give me an advice about this?
Regards,
Andrew