Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
 <div id="divVaid">
        @Html.ValidationSummary(false)
    </div>

@using (Ajax.BeginForm("UpdateProfileUser", "User", new AjaxOptions
{
    HttpMethod = "POST",
    OnSuccess = "backtopage",
    UpdateTargetId = "divVaid",
    InsertionMode=InsertionMode.InsertBefore

}))


C#
 [HttpPost]

        public ActionResult UpdateProfileUser(UserDetailsListEnity objContactColletion)
        {
 if (TryValidateModel(objContactColletion))
            {
  return Json(true);
            }
            else
            {
                return Json(false);
}
}


I want to just show Error msg in ValidationSummary
Posted
Comments
Er Daljeet Singh 21-Apr-14 6:54am    
You can use jquery for this.
else try ModelState.AddError() functiin in your Action

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900