RadControls for ASP.NET AJAX Telerik RadEditor provides a client-side object of type RadEditor. You can get a reference to the editor using $find("<%=name.ClientID%>");The following code demonstrates this:
CopyASPX
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>
<script type="text/javascript">
Sys.Application.add_load(function ()
{
var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor's client object
alert(editor.get_id()); //returns RadEditor Client ID
}
);
</script> Note |
|---|
You should note that in MS ASP.NET AJAX client control objects are created in a manner similar to this: CopyASPX .......
<script type="text/javascript">
</script>
</body>
</html>
You can see that the client object representation of MS AJAX controls are created just as the last code on the page in the Sys.Application.init event, which is raised after the window.onload event. For that reason you can get a reference to RadEditor no earlier that in the Sys.Application.load event, which is raised after all scripts have been loaded and the objects in the application have been created and initialized.
|
Having the client-side RadEditor object, you can access its public properties and methods.
See Also