title: Numeric validation for textbox inside Gridview
body: <p>I have textbox inside gridview. need to validate this textbox for numeric values.i tried using below code but its giveng me object required error.my code is as shown below.    </p>
  
  <pre><code>&lt;asp:TabContainer ID="tcexe" runat="server" ActiveTabIndex="0"  AutoPostBack="true"&gt;
  &lt;asp:tabpanel&gt;
  &lt;asp:gridview&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:TextBox ID="txt1" runat="server" MaxLength="4" Text='&lt;%# Eval("value") %&gt;'
       OnKeyPress=" return AllowNumericOnly(this);"&gt; javascirpt used is function 
  &lt;/ItemTemplate&gt;
  &lt;/asp:TenGrid&gt;
  &lt;/asp:tabpanel&gt;
  
  AllowNumericOnly(e) 
  { 
       var keycode; 
       if (window.event) 
            keycode = window.event.keyCode; 
       else if (event) 
            keycode = event.keyCode; 
       else if (e) 
            keycode = e.which; 
       else return true; 
       if ((keycode &gt; 47 &amp;&amp; keycode &lt;= 57)) { return true; }
       else { return false; } return true;
  } 
  </code></pre>
  
  <p>i need to support this functionality in Mozilla and IE. can anyone help me </p>