This is a migrated thread and some comments may be shown as answers.

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

2 Answers 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 08 Mar 2009, 11:30 AM
Hi,

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 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 09 Mar 2009, 08:31 PM
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.

Cheers!
0
Santhosh
Top achievements
Rank 1
answered on 10 Mar 2009, 05:54 AM
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

Telerik.Web.UI.

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

 

Ctrl.ID =

"CustomSection" + CustomSectionNameIndex;

 

Ctrl.EnableEmbeddedSkins =

false;

 

TableRow

Row = new TableRow();

 

 

TableCell TabCell = new TableCell();

 

TabCell.Controls.Add(Ctrl);

Row.Cells.Add(TabCell);

TabCell =

new TableCell();

 

 

Button DelBut = new Button();

 

DelBut.Text =

"Delete this Section";

 

DelBut.ID =

"CustomButton" + CustomSectionNameIndex;

 

TabCell.Controls.Add(DelBut);

Row.Cells.Add(TabCell);

TableCustomSections.Rows.Add(Row);

CustomSectionNameIndex += 1;



It will works for only one time.

Can u please help me otherwise can anybody send me a sample
Tags
Editor
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Santhosh
Top achievements
Rank 1
Share this question
or