how to validate number insert to a textbox field?

I have a textbox in a form where I need to enter the number of users. I need to make sure the person enters a number on that field. How can I validate that field?
code----
<tr>
<td class="NavyBold">Number of Users
<br>
(if multiple users):</td>
<td><asp:textbox id="txtusernumber" Runat="server" Width="50Px" MaxLength="4"></asp:textbox></td>
</tr>
devweezAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
msdixonConnect With a Mentor Commented:
add this to your page. it should point you in the right direction:

<asp:comparevalidator id="CompareValidator1" style="Z-INDEX: 104; LEFT: 136px; POSITION: absolute; TOP: 32px"
            runat="server" errormessage="Oops" type="Integer" controltovalidate="txtusernumber" valuetocompare="0"
            operator="GreaterThan"></asp:comparevalidator>
0
 
devweezAuthor Commented:
Worked like a charm! thank you for the quick turn around on your answer. really helped!
0
 
msdixonCommented:
no problem
0
All Courses

From novice to tech pro — start learning today.