title: jQuery scrollTop function goes down first and then animates to top
body: <p>I want to scroll to top if there is an error on postback of a button click. I am working on asp.net C#. I am using following method to scroll to top.</p>
  
  <p>.cs code on page_load method</p>
  
  <pre><code>if (IsPostBack)
  {
      System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "ScrollPageLogin", "ResetScrollPositionLogin();", true);
  }
  </code></pre>
  
  <p>.ascx code for jquery call</p>
  
  <pre><code>function ResetScrollPositionLogin()
  {
     $('html, body').animate({ scrollTop: 0 }, 'fast');
  }
  </code></pre>
  
  <p>When I use this code and click on login button then it scroll to the down first and then scroll to up.  Please help me to resolve this.     </p>