title: Going to a specific page number in a GridView paging feature
body: <p>I am trying to implement GO TO page by allowing the user to enter page number in a text box and clicking a button texted as GO. </p>
  
  <p>.aspx code is; </p>
  
  <pre><code>&lt;asp:Label ID="lblGoToPage" runat="server" Text="Go To Page : "&gt;&lt;/asp:Label&gt;
  &lt;asp:TextBox ID="txtGoToPage" runat="server" Width="47px"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGo_Click" /&gt;
  </code></pre>
  
  <p>and .cs code is; </p>
  
  <pre><code>protected void btnGo_Click(object sender, EventArgs e)
      {
          GridView1.PageIndex = Convert.ToInt16(txtGoToPage.Text);
          txtGoToPage.Text = "";
      }
  </code></pre>
  
  <p>These above lines of code are giving out but not the desired one. Cant figure out where I am going wrong. Any help will be much appreciated. Thanks in advance.</p>