Hi mieric,
Please try the example below
- <%@ Page Language="VB" %>
-
- <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
-
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
- If Not FCKeditorKB2.ToolControls("FormatBlock") Is Nothing Then
- Dim dropdown As CuteEditor.RichDropDownList
- Dim richitem As CuteEditor.RichListItem
- dropdown = DirectCast(FCKeditorKB2.ToolControls("FormatBlock").Control, CuteEditor.RichDropDownList)
-
- richitem = dropdown.Items(0)
-
- dropdown.Items.Clear()
-
- dropdown.Items.Add(richitem)
-
- dropdown.Items.Add("Normal", "<p>")
-
- dropdown.Items.Add("Heading 1", "<h1>")
-
- dropdown.Items.Add("<b style='font-size:9pt'>[[Heading 5]]</b>", "Heading 5", "<h5>")
-
- dropdown.Items.Add("Deleted Text", "<del>")
-
- End If
-
- End Sub
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <CE:Editor ID="FCKeditorKB2" runat="server">
- </CE:Editor>
- </div>
- </form>
- </body>
- </html>
- <script>
- var editor1=document.getElementById("<%= FCKeditorKB2.ClientID %>");
- function getSelectedHTML(){
- // get the active editor window
- var editwin = editor1.GetWindow();
- // get the active editor document
- var editdoc = editor1.GetDocument();
- var rng=null,html="";
- if (document.selection && document.selection.createRange){
- rng=editdoc.selection.createRange();
- html=rng.htmlText||"";
- }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;
- }
-
- function CuteEditor_OnCommand(editor,command,ui,value)
- {
- if(command=="FormatBlock")
- {
- if(value=="<del>")
- {
- editor.PasteHTML("<del>"+getSelectedHTML()+"</del>");
- }
- }
-
- }
- </script>
Regards,
ken