【发布时间】:2010-08-16 01:30:34
【问题描述】:
我有以下代码;
$.ajax({
url: "/Home/jQueryAddComment",
type: "POST",
dataType: "json",
data: json,
contentType: 'application/json; charset=utf-8',
success: function(data){
//var message = data.Message;
alert(data);
$('.CommentSection').html(data);
}
在我的控制器中;
[ValidateInput(false)]
public ActionResult jQueryAddComment(Comment comment)
{
CommentSection commentSection = new CommentSection();
//ya da - ya da
// fill the commentsection object with data
//then
return PartialView("CommentSection", commentSection);
}
但是,当我返回页面时,不会出现成功警报。谁能看出这个逻辑的缺陷?
【问题讨论】:
-
对帖子的当前反应是什么?使用 Firebug 和/或 Fiddler 检查响应。
标签: asp.net-mvc jquery