Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: ASP.NET .NET Performing custom validation Tutorial

Demonstrates how to use custom validation on a form by checking to see if a string in a TextBox is not the same with a string from an array (or database), case in which it displays 'This name is already taken'.

Tutorial Details:

Performing custom validation

Demonstrates how to use custom validation on a form by checking to see if a string in a TextBox is not the same with a string from an array (or database), case in which it displays 'This name is already taken'.

You'll often want to use custom validation to validate a control on a webform. Perhaps when a user registers on your website you want to check the database to see if the name he wants to register doesn't already exist. If you don't know the basics of form validation, first read the tutorial named ' Validate using RequiredFieldValidator '.

Start a new ASP .NET Web Application project named customValidation and drag a TextBox , a Button and a CustomValidator to WebForm1.aspx .

Now set the ErrorMessage property of CustomValidator1 to "This name is already taken". Also set the ControlToValidate property to TextBox1.

Now let's get into the C# code. We won't bother with a real database in this project, we will replace it with an array that holds 3 names.

At this time we only need to set the ServerValidate event to validateName . We'll do this using the Properties window of Visual Studio .


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
ASP.NET .NET Performing custom validation Tutorial

View Tutorial:
ASP.NET .NET Performing custom validation Tutorial

Related Tutorials:

JavaWorld - Net News Central
JavaWorld - Net News Central
 
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000
 
Rumble in the jungle: J2EE versus .Net, Part 1
Rumble in the jungle: J2EE versus .Net, Part 1
 
Rumble in the jungle: J2EE versus .Net, Part 2
Rumble in the jungle: J2EE versus .Net, Part 2
 
A first look at JavaServer Faces, Part I
A first look at JavaServer Faces, Part Learn how to implement Web-based user interfaces with JSF
 
Let the mobile games begin, Part 2
Let the mobile games begin, Part 2
 
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP).
 
SQL Database Access with DBTags
SQL Database Access with DBTags In a J2SE or J2EE application, Java Database Connectivity (JDBC) can be used to create a connection with a SQL database, create database tables, retrieve result sets, and update the database. To use a database from a Jav
 
XML Document Validation with an XML Schema
This tutorial explains the procedure of validating an XML document with an XML schema.
 
Java validation with dynamic proxies
Decouple validation processes from your business object implementations.
 
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack
 
JavaServer Faces Technology
JavaServer Faces technology is a server-side user interface component framework for Java technology-based Web applications.
 
This tutorial shows how to Creating Custom JSP Tag Libraries
JSP 1.1 introduced an extremely valuable new capability: the ability to define you own JSP tags. You Define how the tag, its attributes, and its body are interpreted, then group your tags into collections called tag libraries that can be used in any numbe
 
Strut your stuff with JSP tags
Learn how to use the custom tags from the open source Struts library and create extensions that ease the coding of properties associated with field values and user input validation. The Struts package is part of the open source Jakarta project.
 
Welcome to the Apache Struts Tutorial
This is the complete Struts Tutorial. Explains ActionForm Action Class Validation Framework.
 
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java Open Source Web Frameworks in Java Struts Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
Struts Guide
Struts Guide Struts Guide This tutorial is extensive guide to the Struts Framework. In this tutorial you will learn how to develop robust application using Jakarta Struts Framework. This tutorial assumes that the reader is familiar with the web
 
Struts Validator Framework Tutorial with Example
Struts Validator Framework Tutorial with Example Struts HTML Tags Struts Validator Framework This lesson introduces you the Struts Validator Framework. In this lesson you will learn how to use Struts Validator Framework to validate the user
 
What is WAP? Detailed discussion of WAP API with examples.
What is WAP? Detailed discussion of WAP API with examples. Learn WAP in 60 minutes W ireless Application Protocol or WAP for short, allows the developers to develop next generation web application for cellular devices. Through WAP enabled mobile
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.