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

Access Radeditor within user control from another user control

3 Answers 115 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chris @ Intrinsic
Top achievements
Rank 1
Chris @ Intrinsic asked on 03 Nov 2010, 07:39 PM
Hi.  How would I access the Radeditor from within a user control?  
I have a user control (details.ascx) that has a user control embedded in it (editor.ascx) 
that only contains a radeditor control.  so, from within the details.ascx javascript code,
I want to be able to access the radedit control inside the editor.ascx.  I couldn't get a
reference to the radedit.  previously I had the editor.ascx replaced with just an RadTextBox
and it worked perfectly.    but, I just tried the user control yesterday, and I cannot find
a way to access the radeditor.  In the details.ascx page_load on serverside, I set a hidden
field to the usercontrol's radeditor ID, but that doesn't seem to work as in client side, I
get a not defined error. 

(also, this is all within a content page within a masterpage scenario (which didn't seem to
affect anything.) And, all the examples on the forums are just too simplistic as it is
accessing the radeditor from within an aspx page, not an ascx page.








My code sample below:  (from details.ascx)


function OnSearchClose(oWnd, args) {
//get the transferred arguments
var arg = args.get_argument();
if (arg) {
var ClauseName = arg.ClauseName;
var txtName = $find("<%= rtbClauseName.ClientID %>");
txtName.set_value(ClauseName);
                       //the above code works perfectly as it is just accessing
                        // a radtextbox within details.ascx



        
    //document.getElementById('hdEditorID').value;

//This code above is accessing the hiddenfield on the page, but just returns
//null, so I'm not sure how to get a reference to the radeditor on the usercontrol

         }

3 Answers, 1 is accepted

Sort by
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 04 Nov 2010, 12:40 AM
Solved my own issue.

simply set ClientIdMode = "Static"  in my radeditor control, and
was able to find the control by using $find("RadEditor1");

Strange, there was no mention of this in any of the telerik support documentation or even any google search!

0
Ian
Top achievements
Rank 1
answered on 14 Feb 2011, 03:22 PM
I too am having problems with the radeditor, also in a user control.

but mainly with the dialog manager not working. i can access the content of the editor in the codebehind, but the dialog manager opens with a 'web.config error' .

My post: My Post

I dont know what to do.

Thanks

Ian
0
Rumen
Telerik team
answered on 17 Feb 2011, 09:59 AM
Hello Ian,

Please, try the suggestions and especially point 4 in the following KB article: Error: Web.config registration missing! The Telerik dialogs require a HttpHandler registration in the web.config file.

Best regards,
Rumen
the Telerik team
Tags
Editor
Asked by
Chris @ Intrinsic
Top achievements
Rank 1
Answers by
Chris @ Intrinsic
Top achievements
Rank 1
Ian
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or