Go to Verification Summary - ASP.net MVC

When a user clicks a button in my application that causes validation errors, is there a way for the page to scroll to the location of the validation summary if there are errors? I need to do this for both cases:

  • Client validation prevents page submission
  • Server check re-displays the web page

Is there an easy way to do this in MVC?

+6
source share
1 answer

jquery scroll to a certain position of the div in case of error and focus <- This message has a similar requirement - the claimed solution is a js function that runs on dom-load, which scrolls the window to the desired position. Correctly implemented, this can create a solution for both client-side and server-side verification.

+2
source

Source: https://habr.com/ru/post/908902/


All Articles