我在我的页面上使用了FCKEditor。如何在数据库中保存FCKEditor的文本?
,我想节省这样的错误我的网页上A potentially dangerous Request.Form value was detected from the client (LongDescriptionVal="<p>hello..</p>").
发生及其对database..but内容..
我在做什么是在这里: -
aspx.cs: -
protected void btnadd_Click(object sender, EventArgs e)
{
string _detail = Request["LongDescriptionVal"].ToString();
string query = "insert into Description(description) values('" + _detail.Trim() + "')";
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
和ASPX: -
<strong>Full Description :</strong>
<br />
<!--Editor Code comes here -->
<script type="text/javascript">
<!--
var oFCKeditor = new FCKeditor('LongDescriptionVal') ;
oFCKeditor.BasePath = 'fckeditor/';
oFCKeditor.Height = 300;
oFCKeditor.Value = '<%=FullDescription%>';
oFCKeditor.Create() ;
//-->
</script>
<br />
<asp:Button ID="btnadd" runat="server" Text="Add" OnClick="btnadd_Click" />
谁能告诉我,我怎么能保存数据资料基地......
在此先感谢..
感谢所有..现在它正在运行.... – divya 2011-06-02 10:51:38