Add custom button

Last post 03-07-2006, 11:08 AM by jselnekovic. 1 replies.
Sort Posts: Previous Next
  •  02-09-2006, 4:55 AM 15742

    Add custom button

    Hello,
     
    I am trying to add a button to CE according to how_to_create_custom_button.aspx in /vb
     
    So I have this code:
     

    Dim pos As Integer = editor.ToolControls.IndexOf("italic") + 1

    Dim ctrl As Web.UI.WebControls.WebControl = editor.CreateCommandButton("myButton", "anchor.gif", "Insert Articles")

     

    editor.InsertToolControl(pos, "myButton", ctrl)
     
    and the CE:
     

    <CE:Editor ID="editor" runat=server Width =600 AllowPasteHtml =true AutoConfigure =full BorderWidth =3

    OnPostBackCommand = "saveFile" >
     
    But it's not working...
     
    What am I doing wrong?
     
    Thank you
  •  03-07-2006, 11:08 AM 16797 in reply to 15742

    Re: Add custom button

    Did you connect the button to a JavaScript function?
     

    ctrl.Attributes["onclick"] = "DoSomething(this)";

View as RSS news feed in XML