return bool from asp.net mvc actionresult

You could return a json result in form of a bool or with a bool property. Something like this:

[HttpPost]
public ActionResult SetSchedule(FormCollection collection)
{
    try
    {
        // TODO: Add update logic here

        return Json(true);
    }
    catch
    {
        return Json(false);
    }
}

Leave a Comment