在线文本编辑器
本人想要制作一个简单的在线编辑器,功能如下图所示。不知哪位好心人可以帮忙。[img]C:\Documents and Settings\zl\My Documents\文本编辑器.bmp[/img]一般到网上找一个用就成了,要是自己做的话估计也不是一件小工程……
呵呵…… fckedit~ 文本编辑器?是个控件吧?
没用过,帮顶一下,请高手指点一下 我一般都用FCKeditor这个编辑器……
很好用的,添加到工具栏中之后就和控件差不多了……
呵呵……
WQedit在线编辑器
这个编辑器是如何获取值的啊。。。。高手帮帮忙 后台直接点 控件名.value 前台 页面 ASPX<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addnews.aspx.cs" Inherits="admin_news_addnews" ValidateRequest="false"%>
<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<title></title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<link href="../../admin/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.ziti4 { BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px; FONT-WEIGHT: normal; FONT-SIZE: 12px; BORDER-LEFT: #999999 1px; COLOR: #1f456b; LINE-HEIGHT: normal; BORDER-BOTTOM: #999999 1px solid; FONT-STYLE: normal; BACKGROUND-COLOR: #7cbed3; FONT-VARIANT: normal }
.bian1 { BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px; BORDER-LEFT: #999999 1px; BORDER-BOTTOM: #999999 1px solid; BACKGROUND-COLOR: #efefef }
.STYLE4 { BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px; FONT-WEIGHT: normal; FONT-SIZE: 13px; BORDER-LEFT: #999999 1px; COLOR: #1f456b; LINE-HEIGHT: normal; BORDER-BOTTOM: #999999 1px solid; FONT-STYLE: normal; BACKGROUND-COLOR: #7cbed3; FONT-VARIANT: normal }
.ziti4 {
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
color: #1F456B;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: none;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: none;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
background-color: #7CBED3;
}
.bian1 {
border-top-style: none;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: none;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #999999;
border-right-color: #999999;
border-bottom-color: #999999;
border-left-color: #999999;
background-color: #EFEFEF;</style>
<script>
function CheckAll()
{
if(window.document.all.drpclass.selectedIndex == 0)
{
alert("请选择要发布新闻的类型!");
return false;
}
if(window.document.all.txtheadline.value =="")
{
alert("请输入文章标题!");
return false;
}
if(window.document.all.txtTime.value =="")
{
alert("请输入文章发表时间!");
return false;
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<table width="800" cellpadding="0" cellspacing="1" border="0" style="z-index: 100; left: 0px; position: absolute; top: 0px">
<tr height="30">
<td colSpan="2" class="ziti4"> ◆您现在的位置:新闻管理>>添加文章
</td>
</tr>
<tr height="25">
<td class="ziti4" align="right" width="100">所属类型:</td>
<td width="700" class="bian1"><asp:dropdownlist id="drpclass" CssClass="ziti3" runat="server">
<asp:ListItem Selected="True" Value="0">---请选择---</asp:ListItem>
<asp:ListItem Value="1">新闻</asp:ListItem>
<asp:ListItem Value="2">案例</asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr height="25">
<td class="ziti4" align="right" width="100">文章标题:</td>
<td width="700" class="bian1"><asp:textbox id="txtheadline" CssClass="ziti3" runat="server" Width="300px" MaxLength="100"></asp:textbox>
</td>
</tr>
<tr height="25">
<td class="ziti4" align="right" width="100">URL:</td>
<td width="700" class="bian1"><asp:textbox id="txtURL" CssClass="ziti3" runat="server" Width="300px" MaxLength="100"></asp:textbox>
<asp:RegularExpressionValidator ID="rev" runat ="server" ControlToValidate="txtURL" ErrorMessage="输入的Url格式不正确!" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>
</td>
</tr>
<tr height="25">
<td class="ziti4" align="right" width="100">文章发表时间:</td>
<td width="700" class="bian1"><asp:textbox id="txtTime" CssClass="ziti3" runat="server" Width="191px" MaxLength="20"></asp:textbox>
</td>
</tr>
<tr height="25">
<td class="ziti4" vAlign="top" align="right" width="100">文章内容:</td>
<td width="700" vAlign="top" class="bian1"><FCKEDITORV2:FCKEDITOR id="fck" runat="server" Height="500px"></FCKEDITORV2:FCKEDITOR></td>
</tr>
<tr height="25">
<td colspan="2" align="center" class="ziti4"> <asp:button id="ButOK" runat="server" Text=" 添 加 文 章 " OnClick="ButOK_Click"></asp:button></td>
</tr>
</table>
</form>
</body>
</HTML> StringBuilder sql = new StringBuilder();
sql.Append("insert into news(type,Title,strtime,Contents,AddTimes,url)");
sql.Append("values(");
sql.Append("'" + this.drpclass.SelectedValue.ToString() + "',");
sql.Append("'" + this.txtheadline.Text.Trim() + "',");
sql.Append("'" + this.txtTime.Text.Trim() + "',");
sql.Append("'" + this.fck.Value + "',");这里是获取值
sql.Append("'" + DateTime.Now.ToString() + "',");
sql.Append("'" + this.txtURL.Text.Trim() + "'");
sql.Append(")");
ProcessData.DefaultControl.Execute(sql.ToString());
MessageBox.MessageBox.Show(this, "文章添加成功!");
this.drpclass.SelectedIndex = 0;
this.txtheadline.Text = "";
this.fck.Value = "";
this.txtURL.Text = "";
return; WEB.CONFIG 中的配置
<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
<connectionStrings/>
<system.web>
<!--
设置 compilation debug="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<appSettings>
<!--about数据库 -->
<add key="ConnectionString" value="server=192.168.0.19;database=about;uid=sa;pwd=sa"/>
<!--配置新闻编辑器 -->
<add key="FCKeditor:BasePath" value="/about/admin/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="/about/file/"/>
<!--配置邮件 -->
<add key="from" value="icityid@icityid.cn"/>
<add key="SmtpServer" value="mail.icityid.cn"/>
<add key="username" value="icityid"/>
<add key="password" value="147258369159753"/>
</appSettings>
</configuration> 还要有FCK的DLL文件 的 一些 JS文件就可以用了
页:
[1]
