Re: Is there a way to "select none" before the PasteHTML command

  •  10-04-2005, 2:16 PM

    Re: Is there a way to "select none" before the PasteHTML command

    Adam,
     
    After upgrading to version 5, the 'SelectNone' command worked, however it didn't unselect tags such as <div> and <img> as I expected. It only seems to unselect text. I was able to make it work by executing 'SelectAll'  and then 'SelectNone'. For the benifit of others, here's the code that I used:
     
    tc = Editor1.ToolControls("insertcustombutonhere")
    Image1 = New System.Web.UI.WebControls.Image
    Image1.ToolTip = "Select None and Insert HTML"
    Image1.ImageUrl = "images/myimage.gif"
    Image1.CssClass = "CuteEditorButton"
    SetMouseEvents(Image1)
    Image1.Attributes("onclick") = "CuteEditor_GetEditor(this).ExecCommand('SelectAll',false,'');CuteEditor_GetEditor(this).ExecCommand('SelectNone',false,'');CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'<div>my html</div>')"
    tc.Control.Controls.Add(Image1)
     
     
    Thanks for your help,
     
    James
View Complete Thread