I am working in Mvc4. Creating a validation. When I am clicking the submit button and the validation is getting failed and the full page is getting refreshed to display the validation messages. I do not want my page to get refreshed. And another question is is there any way to do the model validation without Httppost?
Best How To :
In the server-side validation ,the page must be submitted via a postback to be validated on the server and if the model data is not valid then the server sends a response back to the client. With client-side validation, the input data is checked as soon as they are submitted, so there is no postback to the server and there is no page refresh.
By Using the Code you can add client side validation. Please add following app setting code snippet in the web.config file.
<add key="ClientValidationEnabled" value="true" />
Please add below scripts in your view.
Please try with above code and let me know if any concern. Please check below demo link for more detail.