62,046
社区成员
发帖
与我相关
我的任务
分享
$("#btn_sumbit").click(
function () {
var title = $("#lable_title").html();
var fck = FCKeditorAPI.GetInstance("FCKeditor1");
var context = fck.GetHTML();
if (!confirm('确定要提交信息?'))
return false;
$.ajax({
type: "post",
url: "../DataHandlers/BBS/Bbs_Edit.aspx?method=postedit&id=" + GetQueryStringValue("id") + "&title=" + encodeURIComponent(title) + "&postcontext=" + encodeURIComponent(context) + "&typeid=" + GetQueryStringValue("typeid"),
success: function (status) {
if (status == 0) {
hiddenFck();
alert('信息已提交 待审核');
}
else
alert('数据错误')
},
error: function () { alert('error') }
});
}
);
protected void Page_Load(object sender, EventArgs e)
{
string method = Request["method"];
if (method != null)
{
string msg = string.Empty;
string typeid = Request["typeid"];
switch (method)
{
case "postedit":
string id = Request["id"];
string title = Request["title"];
string post_context = Request["postcontext"];
Bbs_Posting info = new Bbs_Posting();
info.Title = title;
info.Context = post_context;
info.CreatedBy = int.Parse(EFContext.Current.UserIdentity);
info.Created = DateTime.Now;
if (!id.IsNullOrEmpty())
info.PId = int.Parse(id);
if (!typeid.IsNullOrEmpty())
info.TypeId = int.Parse(typeid);
if (IBbs_ManagersService.EditPost(info))
Response.WriteAndEnd((byte)AjaxResponseCode.Success);
else
Response.WriteAndEnd((byte)AjaxResponseCode.DataError);
break;
default:
break;
}
}
}