title: Scroll down to the specific part of page when a linkbutton is clicked using MaintainScrollPositionOnPostBack
body: <p>I have a lengthy asp.net page. An HTML table in the page has a link with <code>&lt;a&gt;</code>. when the link is clicked the page shows the textbox using javascript and takes me to the top part of the page. Instead, i want to see the part of the page that has the link and textbox. It should automatically scroll down to that part once the page refreshes. How is that possible?</p>
  
  <p>I have tried using Linkbutton instead of  but have issues with javascript.</p>
  
  <p>Here is the code.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(
  function()
  {
      $("#aChangeDefault").click
      ( 
  
          function()
          {
              alert('hi');
              //$("#&lt;%=trChangeLoc.ClientID %&gt;").fadeIn(1000);
              $("#&lt;%=rowChangeLoc.ClientID %&gt;").fadeIn(1000); 
          }
      )
  
      $("#btnClose").click
      (
         function()
          {
              $("#&lt;%=rowChangeLoc.ClientID %&gt;").fadeOut(1000);    
  
              if(document.getElementById("&lt;%=divSearchResult.ClientID %&gt;").style.display != "none")
              {
                  $("#&lt;%=divSearchResult.ClientID %&gt;").fadeOut(1000);
              } 
              //$("#&lt;%=trChangeLoc.ClientID %&gt;").fadeOut(10);                            
          }
      )       
  }
  
  );
  </code></pre>
  
  <p></p>
  
  <p>The Linkbutton is here :</p>
  
  <pre><code> &lt;asp:LinkButton id="aChangeDefault" runat="server" style="font-size: 12px;font-family:Arial;vertical-align:bottom;" ToolTip = "Click here to set your town as default location" Text ="Change Location" &gt; &lt;/asp:LinkButton&gt;
  </code></pre>
  
  <p>And the portion that shows up when the link is clicked is here:</p>
  
  <pre><code>  &lt;input id="btnClose" type="button" class="closeButton2" language="javascript" onclick="return btnClose_onclick()" /&gt;
    &lt;div style="display: inline-block;"&gt;
      &lt;span class="searchheadder" style="color: #000000; padding-right: 8px; padding-top: 4px;"&gt;
                                          LOCATION: &lt;/span&gt;
        &lt;asp:TextBox ID="txtChangedLocation" onkeyup="doCapitalize();" runat="server" Height="19px"
                                          Width="200px" CssClass="textBox" Style="margin-right: 10px;"&gt;&lt;/asp:TextBox&gt;
       &lt;cc1:AutoCompleteExtender ID="ACE1" runat="server" TargetControlID="txtChangedLocation" ServicePath="../AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="2" CompletionSetCount="10" EnableCaching="true" CompletionInterval="0" &gt;&lt;/cc1:AutoCompleteExtender&gt;
        &lt;asp:Button ID="btnGetNewList" BorderWidth="0" CssClass="searchButton" runat="server" OnClick="btnGetNewList_Click" /&gt;  &lt;/div&gt;
  </code></pre>
  
  <p>Appreciate all your help. Thank you!</p>