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

Dynamic RadEditor Content in Dynamic RadTab

2 Answers 88 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Nilachandan
Top achievements
Rank 1
Nilachandan asked on 23 Oct 2008, 01:47 PM
Hi

I am facing  problem here. I have a master page and content page. In the content page I have a RadDock whose content is coming from a web user control(Lets say abc.ascx). Now abc.ascx contain dynamic tabstrip which uses separate web user control for each dynamic created tab.

In the first tab(RadTab1.ascx)now by click of a button, I am creating a dynamic RadEditor. Both the button and dynamic RadEditor are in the same user control RadTab1.ascx.Upto this everything works fine.

Now my problem is,

I am not able to get the content of RadEditor, while clicking the Reply button below this editor.

My Code is

1. RadDock dockContent = (RadDock)Page.Master.FindControl("defaultPageHome").FindControl("ForumRadDock");
2. RadMultiPage multiPage = (RadMultiPage)dockContent.ContentContainer.FindControl("MyForumMainControl").FindControl("ForumRadMultiPage");
3. RadPageView PageView = multiPage.FindPageViewByID("Newly Added");
4. RadEditor edit = (RadEditor)PageView.FindControl("replyEditor");

Upto Line 3 its working fine. I am also able to get the PageView Id from line 3.
In the line 4 Error"Object reference not set to an instance of an object".
I guess, I am not able to find the reference of RadEditor. Why so?

Pls. help
Chandan

2 Answers, 1 is accepted

Sort by
0
Chayady
Top achievements
Rank 1
answered on 29 Oct 2008, 06:53 AM
I have a similiar problem.

So far what i know, if we create control dynamically,
the control will destroy on postback.
(IMHO : that was the one causing your error)

My problem is, how do i get(maintain) the value of radeditor
so i can re-create and put the same value of the radeditor on postback.

Example : after i create radeditor dynamically, i type "ABC" in that radeditor.
when i postback, i will re-create radeditor and set the html to "ABC"
But i dont know how to get the "ABC" from

Thanks in advance
0
Tervel
Telerik team
answered on 29 Oct 2008, 08:12 AM
Hello everyone,

We are not sure about your scenarios, they seem rather complex - but our suggestion is to first make sure a regular <asp:TextBox> control works in the expected manner. Once you have checked that the standard <asp:TextBox> work, the editor should work OK as well.

In case you are able to successfully get things to work with a textbox, but have a problem when changing it with RadEditor, my suggestion would be to open a support ticket an send us your project to examine. We will then make the necessary corrections and send you back a working version.

Best regards,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Nilachandan
Top achievements
Rank 1
Answers by
Chayady
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or