This is a migrated thread and some comments may be shown as answers.
View State Errors with Sample / Rad Dock
8 Answers 73 Views
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 28 Oct 2009, 06:39 PM
Hello there,


using a sample provided in the following link (http://www.telerik.com/community/forums/aspnet-ajax/docking/dynamic-creation-of-layout-zones-and-docks.aspx)   and even in my own code I get viewstate errors ("...The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. ...")  when I do the following:

In the example provided:

Add a new tab by click create new page.
Add a dock to the first tab.
Go to the second tab.
Add a dock to the second tab.
Go Back to the first tab.  BOOM!  View state error.

Does anyone know a solution for this?  My project is bascially structured exactly like this sample except I use a database.

Thanks,

Brian

8 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 28 Oct 2009, 09:48 PM
The reason this could be happening is that on the initial page load you dynamically add a control to the page (therefore adding it to the control tree) and on the next postback you add a different control in the place of the first control. It would seem that when you switch between the two tabs the docks contained within them are conflicting. I would suggest that you do not cause post-backs on tab clicks and then save/load the ViewState at appropriate times (perhaps before or after the Tab has been clicked).
0
Brian
Top achievements
Rank 1
answered on 28 Oct 2009, 10:03 PM
Well working from the example from telerik the exact same issue occurs.   Are you saying there is no way to have dynamic docks and tabs?    All I am basically looking for is for a working example exaclty like the one that telrik posted (see original post) which has a view state issue.

I have dynamic tabs, and dynamic RadDocks.    When I change tabs, obviously the loaded rad docks are going to change, this will be true regardless of postback from the tab or not.
0
Brian
Top achievements
Rank 1
answered on 29 Oct 2009, 07:34 PM
Adding the following to the .aspx page appears to have solved the problem, but I have not done enough testing yet to ensure that I have not introduced addition issues by turning these properties off:

EnableEventValidation

 

="false" EnableViewState="false" AutoEventWireup="true"

 




It did however get rid of my viewstate errors.


Thanks,

Brian Gaer
0
Pero
Telerik team
answered on 30 Oct 2009, 12:51 PM
Hi Brian,

I tested the project from the forum post that you suggested and it is working correctly. Here is a video captured while testing the project.

When you dynamically create controls you need to ensure that they are created at the right place in the page life-cycle. My recommendation is to recreate the dynamically created controls in the Page_Init before the ViewState is loaded.

Please put together a simple running project and send it back to us, if the problem still persists.

I don't know if it is a good idea to disable EventValidation and ViewState on the page.

Sincerely yours,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Brian
Top achievements
Rank 1
answered on 30 Oct 2009, 05:27 PM
I do not see any video link or attachment.

I am able to reproduce this everytime, using IE8.  Have not tried other browsers.


Steps:

Start Demo
Add a new Tab
Go to first tab
Add 2 different docks
Go to second page, add 2 docks.
Go back to first page and it will give you the view state error.

Thanks,

Brian
0
Pero
Telerik team
answered on 02 Nov 2009, 07:33 AM
Hi Brian,

Please, excuse me I obviously have forgotten to provide the link. Here it is:

http://www.screencast.com/users/metalmkd/folders/Jing/media/2ef3e98a-5114-435d-8072-7d126634f6a9

Still, I am not getting these ViewState errors on my computer. Will you please sent me the running project that you are testing, together with the DLLs?


Regards,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
turkush .
Top achievements
Rank 1
answered on 17 Jun 2011, 08:20 AM
Hi,

im using radDock Ajax control. I ve done the saving of radDock state in database. Now i want to store radDock custom settings in db, like page size of listing of particular radDock and time of interval for refreashing radDock. I want custom command (that is done). on clicking custom command an input page will open and user can select setting like page size 10, refreash interval 5 min. on pressing ok the setting for particulat radDock will save in db and on post backs AND REOPENING next time same setting will apply to them.

is there any wayto do so, or i can just do manually like create table for available docks, and save setting for each dock against userid. and save and reload it.

thanks
0
Pero
Telerik team
answered on 22 Jun 2011, 05:03 PM
Hi,

We have responded to your post in the other forum thread that you have started. Here is a link to it: http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/raddock-custom-settings-save-in-database.aspx.

Regards,
Pero
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Dock
Asked by
Brian
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Brian
Top achievements
Rank 1
Pero
Telerik team
turkush .
Top achievements
Rank 1
Share this question
or