views:

11

answers:

0

I have an ascx usercontrol acting like as a standard createUser formular. Code is written in VB.Net 3.5

The control also has some radiobuttons with the property autopostback=true set. The Radiobuttons controls if the member should be a Company or an Individual. If a radiobutton is clicked, the formular will display or hide certain text-fields.

This works just fine in my developement environment with IIS6 and Windows 7.

When I upload the code to our new live-server (Windows 2008 and IIS7) it seems to work fine until you press a radiobutton with autopostback=true. Then the following HttpException occurs:

System.Web.HttpException 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.

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> at

System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at EFW.Sys.Web.UI.Controls2LoadCollection.LoadContentControl(Control ContentContainer, Control Content)
at EFW.Sys.Web.UI.Controls2LoadCollection.LoadContentControl(Control ContentContainer, String Path) at EFW.Sys.Web.UI.Controls2LoadCollection.LoadContentControls() at EFW.Sys.Web.UI.AbUserControl.OnLoad(EventArgs e) ..

It is really hard to debug since it works in my developement environment. Anyone had this problem?