Hi rajmohanp,
You can find the source code of this demo page in the editor download package "How to/AddDialogs/cs/create_a_custom_dialog.aspx" .
2. How to get the selection html code in the custom dialog?
Use the code below
function getSelectedHTML()
{
var rng=null,html="";
var editor1=Window_GetDialogArguments(window);
// get the active editor document
var editdoc = editor1.GetDocument();
// get the active editor window
var editwin = editor1.GetWindow();
if (document.selection && document.selection.createRange)
{
rng=editdoc.selection.createRange();
if( rng.htmlText )
{
html=rng.htmlText;
}
else if(rng.length >= 1)
{
html=rng.item(0).outerHTML;
}
}
else if (window.getSelection)
{
rng=editwin.getSelection();
if (rng.rangeCount > 0 && window.XMLSerializer)
{
rng=rng.getRangeAt(0);
html=new XMLSerializer().serializeToString(rng.cloneContents());
}
}
return html;
}
Regards,
Ken