예제 #1
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() }));
 }
예제 #2
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() }));
        }