<
asp:Button ID="btnSubmit" runat="server" Text="Save"/>
<
asp:Label ID="body1" runat="server" ></asp:Label>
<
script type="text/javascript">
Telerik.Web.UI.Editor.CommandList[
"Save"] = function(commandName, editor, args) {
var sBody1 = editor.get_document().getElementById("editBody1555365").innerHTML;
document.getElementById(
"body1").text = sBody1;
alert( "Body1: " + document.getElementById("body1").text);
var btnSubmit = $get("<%=btnSubmit.ClientID%>"); //get a reference to the Asp:Button
btnSubmit.click();
//click it programmatically
};
</script>
<
telerik:RadEditor showSubmitCancelButtons="False" editable="true" SaveInFile="False" ID="RadEditor" runat="server" ></telerik:RadEditor>
When I alert the label I am receiving the content as expected. The problem is when I get inside the code behind for my asp.net button when it gets programmatically clicked it doesnt seem to be able to find any content inside my label 'body1' which it should seeing as it alerted the content just before. It is if the content gets erased when the page does a post back before going inside the save button code behind.
Does anyone know how I can get the content for the ID 'editBody1555365' through the code behind?