Hi Expert,
I having a trouble when implementing validation javascript file in my razor view. Following error is thrown while we run the project.
Here is my code,
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<div class="col-md-6">
<label for="name">Name</label>
@Html.TextBoxFor(x => x.Name, new { @maxlength = 50, @autofocus = "autofocus", @class = "form-control", placeholder = "Name" })
@Html.ValidationMessageFor(x => x.Name)
</div>
Please give me the solution to remove this error and implement validation successfully.
Hemant Patel
16-Dec-2017Hi Sophie,
After analyzing your code, I saw you are using your javascript file in wrong way.
Please rearranged your javascript file in the following manner to accomplish your task,
I Hope its informative for you...