我通过jquery提交了一个表单,但我需要ActionResult返回true或false。从asp.net返回布尔值mvc actionresult
这是为控制方法的代码:
[HttpPost]
public ActionResult SetSchedule(FormCollection collection)
{
try
{
// TODO: Add update logic here
return true; //cannot convert bool to actionresult
}
catch
{
return false; //cannot convert bool to actionresult
}
}
我将如何设计我的JQuery调用传递表单数据,并检查返回值是true或false。如何编辑上面的代码以返回true或false?
我喜欢简单的,归结例如,这expunges所有无关的代码。希望95%的其他人,包括图书作者,也会这样做。 – 2012-09-18 05:23:54
@Eclipsoft如果没有被覆盖的话,或许有人有权力讨论关于meta的想法。 – MrBoJangles 2013-01-31 23:18:14