如果用FCKEditor那样的编辑器,好像是设置不允许用户上传,不允许切换html吧。
具体不清楚,不知道能不能实现。
曾经用过一个纯js的UBB编辑器,今天找到一个asp.net下可用的,分享一下。

就是一个web控件,添加方法如下:
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
Default.aspx.cs
"
Inherits
=
"
_Default
"
%>
<% @ Register src = " Ubb/Ubb.ascx " tagname = " Ubb " tagprefix = " uc1 " %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title ></ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< uc1:Ubb ID ="Ubb1" runat ="server" />
< asp:Button ID ="Button1" runat ="server" Text ="Button" onclick ="Button1_Click" />
</ div >
</ form >
</ body >
</ html >
<% @ Register src = " Ubb/Ubb.ascx " tagname = " Ubb " tagprefix = " uc1 " %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title ></ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< uc1:Ubb ID ="Ubb1" runat ="server" />
< asp:Button ID ="Button1" runat ="server" Text ="Button" onclick ="Button1_Click" />
</ div >
</ form >
</ body >
</ html >
using
System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using D.BLL;
public partial class _Default : System.Web.UI.Page
{
private B_UBB bllUBB = new B_UBB();
protected void Page_Load( object sender, EventArgs e)
{
}
protected void Button1_Click( object sender, EventArgs e)
{
string content = bllUBB.UBBToHTML(Ubb1.ContentVlaue);
Response.Write(content);
}
}
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using D.BLL;
public partial class _Default : System.Web.UI.Page
{
private B_UBB bllUBB = new B_UBB();
protected void Page_Load( object sender, EventArgs e)
{
}
protected void Button1_Click( object sender, EventArgs e)
{
string content = bllUBB.UBBToHTML(Ubb1.ContentVlaue);
Response.Write(content);
}
}