I have created some logic around handling error, but im not getting any error. The idea when a user leave @EditorFor must validate the message with image error. I have done this following, but its not working debug nothing, maybe missing something pls assist.
-
-
- [Required(ErrorMessage = " This field is required")]
- [EmailAddress(ErrorMessage = "Invalid email address")]
- public string Email { get; set; }
-
-
-
- <div class="form-group row">
- <label for="Email" class="col-sm-2 col-form-label">Email:</label>
- <div class="col-sm-4">
- @Html.EditorFor(model => model.RegForm.Email, new { htmlAttributes = new { @class = "form-control", autofocus = "autofocus", placeholder = "Email" } })
- @Html.ValidationMessageFor(model => model.RegForm.Email, "", new { @class = "text-danger" })
- </div>
- </div>
-
-
-
-
-
- <!---JavaScript error handling-->
-
- <script type="text/javascript" src="~/Content/dist/js/jquery.validate.min.js">
- </script>
- <script type="text/javascript" src="~/Content/dist/js/jquery.validate.unobtrusive.min.js">
- </script>