ASP.NET
  Home arrow ASP.NET arrow Input Validation With ASP.NET, Part 1
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Input Validation With ASP.NET, Part 1
By: Harish Kamath (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 38
    2004-02-16

    Table of Contents:
  • Input Validation With ASP.NET, Part 1
  • Making Friends
  • First Glance
  • If Looks Could Kill
  • Pizza Power
  • A Comparative Study

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Input Validation With ASP.NET, Part 1


    (Page 1 of 6 )

    Often, application errors are caused by "bad" data entered by end-users. Find out how to protect your Web application from bad data by enforcing validation rules on user input with ASP.NET's Validator objects. This article discusses forcing user input for specific fields, constraining input to a specified range of values and ensuring that the data entered satisfies comparison tests.

    Being Bad

    One of the primary reasons for application errors (and the often-disastrous consequences that follow) is the "bad" data entered by the application's end-users. It's not uncommon to find applications falling apart because the user made a mistake while entering a critical piece of information, especially if the application's been written by a novice developer too inexperienced to know better.

    If that novice developer is you, you're going to thank your stars that you found this article today.

    Now, you can't stop a user from entering bad data into your application, but you can certainly check what's been entered and trigger off warnings if it's incorrect. This process is called input validation, and it's something you must do in every application you develop. This is twice as true for Web applications, which involve lots of forms and databases - if you don't have input validation in your Web-based application, you run the risk of corrupting your database by allowing incorrect, unverified values to be stored in it.

    Over the next few pages, I'm going to show you how you can wrap your code in bulletproof Kevlar, so that no matter how bad the user input is, your code will detect it, warn the user about it, and will keep ticking, instead of blowing all its fuses. In ASP.NET, doing this is surprisingly simple - if you know about the built-in Validators.

    More ASP.NET Articles
    More By Harish Kamath (c) Melonfire


     

    ASP.NET ARTICLES

    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...
    - Building an In-Text Advertising System Under...
    - Developing a Mini ASP.NET AJAX Server Centri...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT