title: FindControl & Change Textbox to Integer?
body: <p>Im pretty new to this an FindControl is completely confusing me. Can anyone please tell me what the code should be to change the input from the TextBox: txtamount to an integer called 'increment'. I can't even find the control.. I've tried Ctype, Cint LoginView1.Findcontrol etc with no joy. Any help is appreciated. Here's the Front end followed by the VB Code...</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="HeadContent"Runat="Server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent"Runat="Server"&gt;
  
  &lt;div style="text-align:center;"&gt;
  
      &lt;asp:LoginView ID="LoginView1" runat="server"&gt;
          &lt;AnonymousTemplate&gt;
              &lt;h2&gt;Please &lt;asp:HyperLink ID="HyperLink2" runat="server"         NavigateUrl="~/register-account.aspx" CssClass="boldStyle"&gt;REGISTER&lt;/asp:HyperLink&gt; or &lt;asp:HyperLink ID="hypLogin" runat="server" CssClass="nyroModal boldStyle" NavigateUrl="~/login2.aspx?page=vipseller"&gt;LOG IN&lt;/asp:HyperLink&gt;&lt;/h2&gt;
  
          &lt;/AnonymousTemplate&gt;
          &lt;LoggedInTemplate&gt;
               &lt;h1&gt;Shop Keeper&lt;h1&gt;
               &lt;h2&gt;Enter cash amount being spent or redeemed by customer:&lt;/h2&gt;
  
               &lt;asp:TextBox ID="txtAmount" runat="server" MaxLength="15" TabIndex="8" &gt;&lt;/asp:TextBox&gt;
               &lt;br&gt;&lt;br&gt;
  
               &lt;asp:Button ID="btnSpent" runat="server" Text="Spent" TabIndex="10" CssClass="button greyShaded" onclick="AddPoints_Click" /&gt;
               &lt;asp:Button ID="btnRedeemed" runat="server" Text="Redeem" TabIndex="10" CssClass="button greyShaded" /&gt;&lt;br&gt;&lt;br&gt;
          &lt;/LoggedInTemplate&gt;
      &lt;/asp:LoginView&gt;
  &lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>VB Code</p>
  
  <pre><code>Protected Sub AddPoints_Click(sender As Object, e As EventArgs)
     dim increment as integer = Cint(LoginView1.FindControl("txtamount"))
     response.write(increment)
  </code></pre>