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.
精彩评论