简单易用的ASP.NET UBB编辑器
有时候需要一个类似留言板的简易编辑器, 不能允许用户直接发html
如果用FCKEditor那样的编辑器,好像是设置不允许用户上传,不允许切换html吧。
具体不清楚,不知道能不能实现。
曾经用过一个纯js的UBB编辑器,今天找到一个asp.net下可用的,分享一下。
![]()
就是一个web控件,添加方法如下:
转换方法:
源码:http://www.it100.info/asp-net-ubb.html
如果用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);
}
}
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。

浙公网安备 33010602011771号