locked
Adding Custom button to htmleditorextender control RRS feed

  • Question

  • User1838979993 posted

    I am trying to add a custom button to a htmleditorextender control.  I have only been able to find solutions for the old htmleditor that is no longer provided in the AJAX toolkit.  Is there a way to add custom buttons?

    Tuesday, June 4, 2013 3:58 PM

Answers

  • User555306248 posted

    The AjaxControlToolkit HTMLEditor extender is built by Obout and added in the latest version 3.0.30512. There are many changes of the class name, method name and namespace, but the two base theories are the same. It is still built on top of the Microsoft ASP.NET AJAX framework.

    So, customize the HTMLEditor ToolBar is to add some client behaviors and DOM documents to it. In the Obout HTMLEditor, the new button is added as the “Custom” type. http://www.obout.com/editor_new/howto_CB.aspx But in the AjaxControlToolkit HTMLEditor, we can achieve this function by adding MethodButton like this: 

    protected override void FillTopToolbar()
    {
    //base.FillTopToolbar();
    
    
    AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton btn=new AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton();
    btn.NormalSrc= "aa.jpg";
    btn.Attributes.Add("onclick", "alert('a');");
    TopToolbar.Buttons.Add(btn);
    
    
    }
    

    http://forums.asp.net/p/1431280/3227712.aspx#3227712

    http://forums.asp.net/t/1652683.aspx

    http://forums.asp.net/t/1599965.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 11:30 PM

All replies

  • User555306248 posted

    The AjaxControlToolkit HTMLEditor extender is built by Obout and added in the latest version 3.0.30512. There are many changes of the class name, method name and namespace, but the two base theories are the same. It is still built on top of the Microsoft ASP.NET AJAX framework.

    So, customize the HTMLEditor ToolBar is to add some client behaviors and DOM documents to it. In the Obout HTMLEditor, the new button is added as the “Custom” type. http://www.obout.com/editor_new/howto_CB.aspx But in the AjaxControlToolkit HTMLEditor, we can achieve this function by adding MethodButton like this: 

    protected override void FillTopToolbar()
    {
    //base.FillTopToolbar();
    
    
    AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton btn=new AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton();
    btn.NormalSrc= "aa.jpg";
    btn.Attributes.Add("onclick", "alert('a');");
    TopToolbar.Buttons.Add(btn);
    
    
    }
    

    http://forums.asp.net/p/1431280/3227712.aspx#3227712

    http://forums.asp.net/t/1652683.aspx

    http://forums.asp.net/t/1599965.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 11:30 PM
  • User-695996974 posted

    It appears that the code you supplied was for the old HTMLEditor, not the new HTMLEditor Extender.  Is that correct?  I can't figure out how to customize the extender, as it appears to be completely different.

    Am I missing something?

    Friday, November 1, 2013 11:10 AM