开发者

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

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!


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());
    }
}

}


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜