Java script error when i adding new Editor control to my web page

3 posts, 0 answers
  1. Santhosh
    Santhosh avatar
    28 posts
    Member since:
    Mar 2009

    Posted 08 Mar 2009 Link to this post


    I am getting an errr when i adding new editor control to my web page.

    the error shows like

    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: 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 help me
  2. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 09 Mar 2009 Link to this post

    Hey Santhosh,

    Could you explain what you are doing on the page that this problem is popping up?  I did a quick search on the website and found that this error can pop up in a number of places, so any more details you can offer would be most helpful. :)

    For example, are you using this with RadAjaxManager or Ajax in general?  Otherwise, how are you loading the Editor onto the page? 

    It'd be extra helpful if you could post your aspx and .cs/.vb into Format Code Blocks here so we could see your exact code, that could help some of the folks here to debug what might be going wrong even faster.

  3. Santhosh
    Santhosh avatar
    28 posts
    Member since:
    Mar 2009

    Posted 10 Mar 2009 Link to this post

    thank you Mr. serin

    I have solved that script problem.

    But my requirement is

    I want to add the RAD Editor dynamically when the user press a button like 'Add Section' and it has been load in a RadAjaxPanel

    i write my code like this


    RadEditor Ctrl = new Telerik.Web.UI.RadEditor();


    Ctrl.ID =

    "CustomSection" + CustomSectionNameIndex;


    Ctrl.EnableEmbeddedSkins =




    Row = new TableRow();



    TableCell TabCell = new TableCell();




    TabCell =

    new TableCell();



    Button DelBut = new Button();


    DelBut.Text =

    "Delete this Section";


    DelBut.ID =

    "CustomButton" + CustomSectionNameIndex;





    CustomSectionNameIndex += 1;

    It will works for only one time.

    Can u please help me otherwise can anybody send me a sample
Back to Top