<input id="txtNum" runat="server" style=" 50px" onkeyup="if(isNaN(value))execCommand('undo');limitLength();" onafterpaste="if(isNaN(value))execCommand('undo');limitLength();" />
<asp:TextBox ID="txtCompany" runat="server" Width="50px" onkeyup="limitSetLengthFour();" onafterpaste="limitSetLengthFour();"></asp:TextBox>