1
I have a view where the contact form is at the bottom of the page, with validation via Dataannotations. When I click the send button, the controller checks the Modelstate, if it is not valid, it returns to the view with the validation messages.
However, it returns at the beginning of the page(view) and as the contact form is at the end of the page, it would have to scroll to the contact to see the messages.
In this case, I am using the bootstrap scrollspy and would like to know if there is how, at the time of returning the view, to return exactly in the contact div, to return directly in the error messages.
I’ve never tried this scrollpsy, but if in the form action you add something like
action="~/Gravar#formId"
doesn’t work?– JamesTK
Jamestk, in this case, as I am using mvc I don’t need to define the form action, but still wouldn’t give result, because the Controller returns the page view and I can’t pass the id of the div as parameter in this Return view();
– Fernando Bigal