AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 How To Validate Integer or Double Numeric values in Asp.Net?
Posted by Moderator1 on  5/9/2009 10:41:45 AM 8902 Views
To check Integer values

int intOutput = 0;
if (System.Int32.TryParse(TextBox1.Text, out intOutput))
{
Response.Write("Valid");
}
else
Response.Write("Not Valid");


To check Double values

double dblOutput = 0;
if (System.Double.TryParse(TextBox1.Text, out dblOutput))
{
Response.Write("Valid");
}
else
Response.Write("Not Valid");

Post New Tips/Tricks View all Tips/Tricks

Featured Resources:
Speech Technology Magazine
Speech Technology is recognized worldwide as the leading source of information on speech technology solutions that are changing communications and technology needs of organizations worldwide.
Building a Web Application Security Program
Learn how to build a pragmatic web application security program that constrains costs while still providing effective security.
100% Free Subscription until Stock lost.View complete list.
Sponsored by