HTML Editor for ASP.NET AJAX
CreateToolbarInfo Event
Server ReferenceWinthusiasm.HtmlEditorHtmlEditorCreateToolbarInfo
Event handler called before the toolbars are created.
Declaration Syntax
C#
public event HtmlEditor..::.CreateToolbarInfoEventHandler CreateToolbarInfo
Remarks
This event allows the developer to modify the toolbar information before the toolbar web controls are created. The HtmlEditor..::.CreateToolbarInfoEventArgs object passed to the event handler includes public methods to:
  • Insert a custom button before, after, or instead of a defined button
  • Insert a custom select list before, after, or instead of a defined select list

The HtmlEditor..::.CreateToolbarInfoEventArgs object passed also includes a public ToolbarInfoList property, enabling more complex modification of toolbar elements.

Examples
Event handler:
CopyC#
protected void Editor_CreateToolbarInfo(object sender,
                                        HtmlEditor.CreateToolbarInfoEventArgs e)
{
    // Insert a custom button
    e.InsertCustomButton("MyButton",
                         "~/Images/MyButton.gif",
                         "This is my button",
                         "OnMyButtonClick(this)",
                         "Link",
                         HtmlEditor.CreateToolbarInfoEventArgs.InsertType.Before);

    // Create select items for a custom select list
    HtmlEditor.SelectInfo.SelectList items = 
        new HtmlEditor.SelectInfo.SelectList();

    items.Add("First", "1");
    items.Add("Second", "2");
    items.Add("Third", "3");

    // Insert the custom select list with the above items
    e.InsertCustomSelect("MySelectList",
                         items,
                         "OnMySelectListChange(this.options[this.selectedIndex].value)",
                         "Format",
                         HtmlEditor.CreateToolbarInfoEventArgs.InsertType.Replace); 
}

Assembly: Winthusiasm.HtmlEditor (Module: Winthusiasm.HtmlEditor) Version: 2.3.0.0 (2.3.0.0)