Does the HTMLEditor control raise any client-side events?

Posted by SAMIR BHOGAYTA on Samir ASP.NET with C# Technology See other posts from Samir ASP.NET with C# Technology or by SAMIR BHOGAYTA
Published on 2011-12-06T21:19:00.000-08:00 Indexed on 2012/03/18 18:19 UTC
Read the original article Hit count: 287

The HTML Editor has three modes: Design, HTML Text and preview mode.

Design mode is in an IFrame. HTML Text is prensented in a TextArea and preview mode is in another Iframe. The code rendered about these three modes is as below.

iframe
id="editor1_ctl02_ctl00" name="editor1_ctl02_ctl00" marginheight="0" marginwidth="0" frameborder="0" src="javascript:false;" style="height:100%;width:100%;display:none;border-width:0px;">
/iframe>

textarea
id="editor1_ctl02_ctl01" class="ajax__htmleditor_htmlpanel_default" style="height:100%;width:100%;display:none;">
/textarea>

iframe
id="editor1_ctl02_ctl02" name="editor1_ctl02_ctl02" marginheight="0" marginwidth="0" frameborder="0" src="javascript:false;" style="height:100%;width:100%;display:none;border-width:0px;">
/iframe>

In design mode, we can use the following JavaScript to append a callback function in onKeypress event.

script type="text/javascript">
var count = 0;
function pageLoad() {
$get('editor1_ctl02_ctl00').contentWindow.document.body.onkeypress = function() {
count++;
$get('cc').innerHTML = "you input " + count + "charactors";

};
}

/script>

As a same way, you can append another keypress event on TextArea and preview IFrame.


© Samir ASP.NET with C# Technology or respective owner

Related posts about Does the HTMLEditor control raise any client-side events?