this is my Script part in Master page :
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.ui.datepicker.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.ui.core.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="../../Scripts/Validation/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="../../Scripts/Validation/MicrosoftMvcValidation.js" type="text/javascript"></script>
And this is what my Form look like :
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm("Inscription", "Home", FormMethod.Post, new { @class = "search_form", enctype = "multipart/form-data"}))
{ %>
<%: Html.ValidationSummary(true) %>
<div class="editor-label">
<p>
<%: Html.LabelFor(model => model.Mailag) %>
</p>
</div>
<div class="editor-field">
<p>
<%: Html.EditorFor(model => model.Mailag, new { @class = "text longfield" })%>
<%: Html.ValidationMessageFor(model => model.Mailag) %>
</p>
// the reste of code is similaire to the first editor label :
</div>
<% } %>
I have folowed the same instruction in the blog to activate the client side but unfortunately it hasn’t worked for me 🙁 i think i missed something here ?
The Server validation work so fine.
I have removed all
Microsoft*.jsand replaced them with this :All works so fine 🙂