public class CustomEditor : AjaxControlToolkit.HTMLEditor.Editor
{
public CustomEditor()
{
//
// TODO: Add constructor logic here
//
}
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);
{
public CustomEditor()
{
//
// TODO: Add constructor logic here
//
}
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);
}
}
Update:
This new feature has been added to Editor control. You can download it and create custom button in editor control:
http://ajaxcontroltoolkit.codeplex.com/SourceControl/changeset/view/54501
9 comments:
Hi, thank you so much for this article. I wanna creat a custom button to insert a string of html into the content, I know in Obout HtmlEditor, it has a client side api “InsertHtml()”, could you please tell how to realize this with ajax html editor ?
See how to add "correctly" custom buttons here: http://forums.asp.net/p/1432800/3227409.aspx#3227409
Thanks for that new feature.
Thank you so much for this article.
___________________
Vince
Your movies on demand
Many institutions limit access to their online information. Making this information available will be an asset to all.
I just added a tip to my blog showing how to set the default state of the editor's toolbar buttons. http://www.thecodepage.com/post/Change-the-default-state-of-an-AJAXControlToolkit-HTMLEditor-Toolbar-Button.aspx
I put this code into my project, but it doesn't appear to do anything.
Perhaps you can elaborate on how we're supposed to use this code?
Really i impressed. What a wonderful presentation.Now i am happy.Thank You
Post a Comment