Note that there are some explanatory texts on larger screens.

plurals
  1. POValidation Summary working but Individual Validation Messages are Not working
    text
    copied!<p>Before I got into the details, this is what I have</p> <p>Environment : VS 2008 with ASP.NET MVC 2</p> <p>Base Model Code</p> <pre><code> [DisplayName("Current Application Status")] [Required(ErrorMessage = "Current Status has to be provided")] public virtual int CurrStatus{ get; set; } </code></pre> <p>Script References</p> <pre><code> &lt;link href="../../Content/Site.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="../../Content/jqueryui.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="../../Scripts/jquery-1.9.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../../Scripts/jquery-ui-1.10.3.custom.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../../Scripts/jquery.validate.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="../../Scripts/jquery.validate.unobtrusive.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>View Code</p> <pre><code> &lt;tr&gt; &lt;td&gt;&lt;%= Html.LabelFor(model =&gt; model.CurrStatus) %&gt;&lt;/td&gt; &lt;td&gt; &lt;%= Html.DropDownListFor(model =&gt; model.CurrStatus, Model.CurrentStatus, "-- Select Current Status --").ToString().Replace("CurrStatus", "Application.CurrStatus")%&gt; &lt;%=Html.ValidationMessageFor(model=&gt;model.CurrStatus) %&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Controller Code</p> <pre><code> [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create([Bind(Prefix = "Application")] Application model) { try { if (ModelState.IsValid) { //save to db } else { InitSelectListItems(); model.CurrentStatus = CurrentStatusModel.GetModelInstance().GetAllAsSelectListItems(); return View(model); } return RedirectToAction("Index"); } catch { return View(); } } </code></pre> <p>In the view, the validation summary is displaying the list of errors with the model that was submitted. However the individual error messages is not shown for some reason. And to top this, I have enabled client side validation after adding entries into web.config and adding the jQUery scripts into scripts folder. The client side validation is not getting triggered either. Any help on this would be appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload