I’ve a problem with the page jumping after failed asp.net validation. I can restore the scroll state but to do this I need to bind an event after the client side asp.net validators validation fails. I have tried to hook into the events as follows
$('input[type=submit],input[type=image],:button').bind('click', function (e) {
//.. restore scroll state
)};
OR
$('form').bind('submit', function (e) {
//.. restore scroll state
});
These fire before the validation fails and the page jumps
I’ve looked at hooking into the javaScript API for the validators but none of these hooks seem to do the trick.
I’ve looked at this SO Answer but I don’t want to fire the validators manually as this is going to cause other issues.
The solution needs to hook into every page of a built out system so the option of removing the asp.net validators and putting in JQuery validation plugin isn’t realistic.
Any ideas how I can wire into the client side event after the validation fails (in a way that can be put into a master page and applied globally).
Many Thanks
After leaving this up for a while – i think the only way this is ever going to happen is to
Remove the asp.net validators and and do the validation in a custom way with JQuery/Javascript OR
Remove the validation summary altogether and just have the failed validation notification next to the individual fields OR
Maybe consider sonething unpleasant like smart edit to at least get IE running
I think in short there was never going to be a quick pluggable way to do this. Substantial rewrites may have been the only solution
That said if anyone knows different please post