本人是初学者,在使用cuteEditor编辑器时出现问题:从数据库里取出数据再编辑提交即出现乱码,类似这样:#01p#02#03nb#07p;#03nb#07p;#03nb#07p;#03nb#07p; 4)设置工具拦按钮具体功能:Cut#09#08#05ft_Cli#09nt/Cut#09#0adit#05r/C#05nfigurati#05n/#08har#09d 里设置 #01br /#02 #03nb#07p;#03nb#07p;#03nb#07p;#03nb#07p;#03nb#07p; 5)设置工具拦按钮具体功能:Cut#09#08#05ft_Cli#09nt/Cut#09#0adit#05r/C#05nfigurati#05n/#08har#09d 里设置 #01br /#02 #03nb#07p;#03nb#07p;#03nb#07p;#03nb#07p;#03nb#07p; 6)设置语言:希望高手赐教,谢谢了以下是源码
<form id="form1" runat="server">
<div>
<table cellspacing="0" cellpadding="0" border="1" width="100%">
<tr>
<td width="15%">姓名:</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">年龄:</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">颜色:</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">性别:</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">地址:</td>
<td>
<CE:Editor ID="Editor1" runat="server" AutoConfigure="Simple" EditorWysiwygModeCss="CuteSoft_Client/example.css" FilesPath="CuteSoft_Client/CuteEditor"></CE:Editor></td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td>
</tr>
</table>
</div>
</form>-------------------------------------------------------------------------------------------using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class admin_editNews : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
showNewsDetail(getRequestId());
}
public string getRequestId()
{
return Request["id"];
}
public void showNewsDetail(string id)
{
DataAccess.Class1 dac = new DataAccess.Class1();
DataSet ds = dac.getSingleData("select * from Table_1 where t_id='"+ id +"'");
DataTable dt = ds.Tables[Common.Class1.table_Users];
this.TextBox1.Text = dt.Rows[0]["t_name"].ToString();
this.TextBox2.Text = dt.Rows[0]["t_age"].ToString();
this.TextBox3.Text = dt.Rows[0]["t_color"].ToString();
this.TextBox4.Text = dt.Rows[0]["t_sex"].ToString();
this.Editor1.Text = dt.Rows[0]["t_address"].ToString();
} public void updateNews()
{
string t_name = Request.Form["TextBox1"];
string t_age = Request.Form["TextBox2"];
string t_color = Request.Form["TextBox3"];
string t_sex = Request.Form["TextBox4"];//以上部分不会出现乱码 string t_address = Request.Form["Editor1"];//乱码 DataAccess.Class1 ds = new DataAccess.Class1();
ds.ExecuteSql("update Table_1 set t_name='" + t_name + "',t_age='" + t_age + "',t_color='" + t_color + "',t_sex='" + t_sex + "',t_address='" + t_address + "' where t_id='" + getRequestId() + "'");
} protected void Button1_Click(object sender, EventArgs e)
{
updateNews();
Response.Redirect("success.aspx?url=admin_newsList.aspx");
}
}
<form id="form1" runat="server">
<div>
<table cellspacing="0" cellpadding="0" border="1" width="100%">
<tr>
<td width="15%">姓名:</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">年龄:</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">颜色:</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">性别:</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="15%">地址:</td>
<td>
<CE:Editor ID="Editor1" runat="server" AutoConfigure="Simple" EditorWysiwygModeCss="CuteSoft_Client/example.css" FilesPath="CuteSoft_Client/CuteEditor"></CE:Editor></td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td>
</tr>
</table>
</div>
</form>-------------------------------------------------------------------------------------------using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class admin_editNews : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
showNewsDetail(getRequestId());
}
public string getRequestId()
{
return Request["id"];
}
public void showNewsDetail(string id)
{
DataAccess.Class1 dac = new DataAccess.Class1();
DataSet ds = dac.getSingleData("select * from Table_1 where t_id='"+ id +"'");
DataTable dt = ds.Tables[Common.Class1.table_Users];
this.TextBox1.Text = dt.Rows[0]["t_name"].ToString();
this.TextBox2.Text = dt.Rows[0]["t_age"].ToString();
this.TextBox3.Text = dt.Rows[0]["t_color"].ToString();
this.TextBox4.Text = dt.Rows[0]["t_sex"].ToString();
this.Editor1.Text = dt.Rows[0]["t_address"].ToString();
} public void updateNews()
{
string t_name = Request.Form["TextBox1"];
string t_age = Request.Form["TextBox2"];
string t_color = Request.Form["TextBox3"];
string t_sex = Request.Form["TextBox4"];//以上部分不会出现乱码 string t_address = Request.Form["Editor1"];//乱码 DataAccess.Class1 ds = new DataAccess.Class1();
ds.ExecuteSql("update Table_1 set t_name='" + t_name + "',t_age='" + t_age + "',t_color='" + t_color + "',t_sex='" + t_sex + "',t_address='" + t_address + "' where t_id='" + getRequestId() + "'");
} protected void Button1_Click(object sender, EventArgs e)
{
updateNews();
Response.Redirect("success.aspx?url=admin_newsList.aspx");
}
}
string t_address = Request.Form["Editor1"];//乱码
而应该用
string t_address = Editor1.属性,应该有属性表示这个控件的HTML代码,或者文本别使用Request.Form了,那样用服务器控件就没什么意义了
this.Editor1.Text = dt.Rows[0]["t_address"].ToString(); 我编辑后再次提交的时候用string t_address = this.Editor1.Text好像取到的还是从数据库里取出来的值,也就是说我的编辑没有起到作用,有什么其他的方法可以避免这种情况呢?