View State Errors with Sample / Rad Dock

9 posts, 0 answers
  1. Brian
    Brian avatar
    10 posts
    Member since:
    Jul 2008

    Posted 28 Oct 2009 Link to this post

    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
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 28 Oct 2009 Link to this post

    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).
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian
    Brian avatar
    10 posts
    Member since:
    Jul 2008

    Posted 28 Oct 2009 Link to this post

    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.
  5. Brian
    Brian avatar
    10 posts
    Member since:
    Jul 2008

    Posted 29 Oct 2009 Link to this post

    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
  6. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 30 Oct 2009 Link to this post

    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.
  7. Brian
    Brian avatar
    10 posts
    Member since:
    Jul 2008

    Posted 30 Oct 2009 Link to this post

    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
  8. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 02 Nov 2009 Link to this post

    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.
  9. turkush .
    turkush . avatar
    10 posts
    Member since:
    Nov 2009

    Posted 17 Jun 2011 Link to this post

    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
  10. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 22 Jun 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017