Failed to load viewstate on simple control
Hi,
I have an TreeView Control on a user control with a simple onClick event on the tree view that fires and does nothing. However, when I click a node in a tree I get the error message below.
I have tried disabling the view state for the treeview and that doesn't work. ASP.NET 4.0 uses indexes to register controls viewstate. Is there a way to force asp.net to use control ids ? I believe this would fix it. Any help would be appreciated.
How to repeat the issue :
1. Add Treeview to user control. Add OnClick event to tree view.
2. Register User Control into SiteFinity
3. Drag widget to SiteFinity page
4. Click a tree node.
Thanks in advance,
Jon
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
Hi Jon,
The idea of the edit mode is to be able to add, remove or edit settings of the controls, widgets or the layout in the page. When you add a widget on the page during edit mode , an ajax request is made to the server to get the widget HTML and then the result is added to the page. That's why the widget and it's controls are not represented in the view state of the page and you receive this error when you trigger the postback event. We know this issue and we are going to prevent the clicking on widget's content during the edit mode of the page.
Kind regards,
Teodor
the Telerik team
I had this same problem today and found a work around that works for my case - maybe yours too.
There is a related thread here:
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/no-viewstate.aspx
In my case, my pages use a Master Page file as a template (I'm migrating existing design from SF 3.7 and not using layout controls at all).
Enabling ViewState on my master page fixed this issue for me.
<%@ Master Language="C#" EnableViewState="true" %>
Hope this helps some until a fix is released.