var Save_Options = new AjaxOptions { HttpMethod = "POST", Url = Url.Action( "_ManageHolidays", new { area = "Masters", controller = "MasterData"} ) OnSuccess = "OnHolidaySuccess" };
function OnHolidaySuccess( e ) { var container = $(".msg_container"); if(e.HasError==false) { $("#displayerror").hide(); var grid = $("#grdHolidays").data("tGrid"); grid.rebind(); alert("Saved"); } else { alert(e.Message.Message); } }
[AcceptVerbs(HttpVerbs.Post)] public ActionResult _ManageHolidays(ObservableCollection<HolidayModel> _holiday) { try { if (_holiday.Select(h => h.Date).Distinct().Count() == _holiday.Count) { save code is done here } else { throw new FaultException("Date cannot be same"); } } catch (FaultException ex) { ModelState.AddModelError("", AppHelper.GetMessageFromException(ex)); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)