用的是ue文本编辑器
$.ajax({
url: "/BBS/ForumReply",
type: "post",
data: "&FSend_Id=" + $("#thread_subject").attr("zj") + "&Content=" + UE.getEditor('editor').getContent() + "&CRSort=" + CRSort,
success: function (msg) {
if (msg == "ok") {
successshow("success");
getData("/BBS/htfy", pages, "", "");
UE.getEditor('editor').setContent("");
} else {
successshow("default");
}
}
})
[HttpPost]
[ValidateInput(false)]
public JsonResult ForumReply()
{
if (Session["UserID"]!=null)
{
string contents = Request["Content"].ToString();
string aa=bll.CheckKeywork(contents);
string bb= Request["CRSort"] == "undefined" ? "" : Request["CRSort"];
int rows = bll.FormeReplay(Convert.ToInt32(Request["FSend_Id"]), contents, Convert.ToInt32(Session["UserID"]), bb);
if (rows > 0)
{
return Json("ok");
}
else
{
return Json("no");
}
}
else
{
return Json("nologin");
}
验证已经关了,就是存在像‘&’这样的字符就会从这往后全部去掉。
前台输入的值
到后台就变成这样了
你空格字符的问题 这个空格符号前面的&把Content这个参数的内容断开了