Saed Al Shaar Dev Tips and Tricks

.NET and SharePoint from a different angle!

Textbox to Accept only Number!


Hi Folks,
Many of the blogs or articles on the net talking about using JavaScript and type code to do that, there is an easier way to that with CompareValidator in ASP.NET.

Here is the CompareValidator you need to have:

ControlToValidate=TextBox1
Text=Enter Numeric Value
Operator=DataTypeCheck
Type=Integer

Happy programming!
Saed

Advertisements

Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: