return Content("0")
以前只看到Return view,return Content("0")百度下,就是返回一个文本,这个文本谁来接收呢? 返回后页面是个什么效果?
[HttpPost, ValidateInput(false)]
public ActionResult Show(int id, FormCollection values)
{
try
{
RegisteredUser va = GetCurrentUser();
if (va != null)
{
var cm = new Comment();
cm.VideoID = id;
cm.Content = values["Content"];
if (CommentBLL.AddComment(cm) == 1)
return PartialView("UCC",
GetPagedCommentsAndRepliesByVideoId(cm.VideoID, 1, CommentPageSize));
return Content("0");
}
return Content("-1");
}
catch (Exception ex)
{
return Content(ex.Message);
}
}
一般使用ajax进行验证,直接返回0,-1进行判断,xmlhttp.resposneText
[解决办法]
谁调用的谁接