tags:

views:

78

answers:

1

Using jquery, when a button is clicked (server side), I want to append #button to the url.

This will only be used when there is validation errors, I want the browser to scroll to the bottom where the button is.

I already tried MaintainScrollPositionOnPostback but it doesn't work here since the validation rows are made visible upon clicking the button.

Update actually clicking the button does a server side post first, so not sure this will work?

A: 

If I understood your problem, you've to fix an ugly asp.net bug, related to a js function (scrollTo) registered for MantainScrollPositionOnPostback.

A quick fix that worked for me is to redefine this function:

window.scrollTo = function(x, y) {
    return true;
}

Of course setting MantainScrollPositionOnPostback="true".

tanathos