How do I scroll to the top of an ASP.NET page after postback?
Posted on 2008-11-04
I use this on top of my ASP.NET page to maintain the scroll position after postback.
<%@ Page Language="VB" MaintainScrollPositionOnPostback="true" %>
This comes in handy because I have a long form, with Listboxes that do Autopostabacks. When I click the Submit button though, I want to page to scroll back to the top of the page, because any error messages are displayed on the top of the page.
How can I accomplish this?