Example #1
0
        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() }));
        }
Example #2
0
 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() }));
 }