我在我的頁面上使用了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