scroll to the top of the page after user change the page in the gridview

<script type="text/javascript" language="javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {
        scrollTo(0, 0);
    }
</script>

Sys.WebForms.PageRequestManager endRequest Event

Raised after an asynchronous postback is finished and control has been returned to the browser.
Syntax

Sys.WebForms.PageRequestManager.instance.add_endRequest(endRequestHandler)
Sys.WebForms.PageRequestManager.instance.remove_endRequest(endRequestHandler)

endRequestHandler: The name of the handler method that will be called.

The endRequest event is raised after an asynchronous postback is finished and control has been returned to the browser. You can use this event to provide a notification to users or to log errors.

http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.WebForms/PageRequestManagerClass/PageRequestManagerEndRequestEvent.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s