How do you implement a Ajax Control Toolkit Custom Editor in a .Net Web Application?

1.8k views Asked by At

I'm trying to implement a customized Ajax Control Toolkit HTML Editor control in a Web Application. How do I do this without using a class in the app_code directory (since it's really not supported, especially in Azure)? Any sample code (vb.net or c#) is greatly appreciated!

2

There are 2 answers

0
Axarydax On

As far as I know, the only way to customize HTML Editor control is to subclass it (and override some of its methods). You really can't use any code in your web application?

edit: Here is a MSDN forum topic about deploying code (C#,VB.NET) to Azure app.

0
simon831 On

Create a separate project and reference it in your website.

<%@ Register Assembly="Library" namespace="MyLibrary.CustomControls" tagprefix="custom" %>
<custom:EditorControl ID="editor" runat="server" />




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AjaxControlToolkit.HTMLEditor;

namespace MyLibrary.CustomControls
{
    public class EditorControl : Editor
    {
        protected override void FillTopToolbar()
        {
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Bold());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Italic());
        }
    protected override void FillBottomToolbar()
    {
        BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.DesignMode());
        BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.PreviewMode());
    }
}

}