public static JsonResult JsonFailResult(this Controller contr, string message, string div, ErrorPlaceholder placeholder = ErrorPlaceholder.Top) { if (placeholder == ErrorPlaceholder.Top) { return(new JsonResult(new { status = "Fail", msg = message, divError = div })); } return (new JsonResult( new { status = "Fail", msg = message, divError = div, placement = placeholder.ToString().ToLower() })); }
protected JsonResult JsonFailResult(string message, string div, ErrorPlaceholder placeholder = ErrorPlaceholder.Top) { return(placeholder == ErrorPlaceholder.Top ? new JsonResult(new { status = "Fail", msg = message, divError = div }) : new JsonResult(new { status = "Fail", msg = message, divError = div, placement = placeholder.ToString().ToLower() })); }