Categories


How to implement custom validation for any transaction and then display the custom validator error m

Raiting 0.00

Description

ASP.NET provides a number of form-level validation controls to validate a wide range of conditions. ASP.NET also provides a ValidationSummary control that is able to collect validator error messages and display them in a single location for ease of readability. Most all of these validator controls deal with form data processing. You may also want to display error messages in the ValidationSummary that have been generated by other processes at the application level and thus you need a way of validating process or transaction completion that employs the ASP.NET validation framework. Using the CustomValidation control, you can easily implement validation of any function, process, or transaction and then display custom validation error messages in the same location as form-level validation messages. And, you'll be able to implement this validation by placing all the code in the CodeBehind page of the web page that you are working with. In this walkthrough, you'll be exposed to how custom validation was implemented for a user page that displays user data. This page is used to view and update user data. The page already employs a number of form-level standard validators, such as the RequiredFieldValidator and RegularExpressionValidator controls. Error messages generated by these validators all appear in one location and are listed and displayed by the ValidationSummary control. The custom validation is triggered whenever the user attempts to update his account information. During the update process, a connection to the website's database is opened, a SQL query string is constructed and then executed against the database. We would like to protect the update process code, and then trigger the custom validator if the update process fails for any reason, display a summary of the error and what to do about it to the user.

Information
Title: How to implement custom validation for any transaction and then display the custom validator error m
Author: StephanBren
Price / Cost: FREE
Platform / OS: ASP.NET, Windows
Version: 1.3
File Size: 12KB
Last Updated: 2004-10-04
URL: Click to Visit
Web site Language: English
Total Votes: 14
Current Rating: 0.00
Total Hits #: 806
Listings ID #: 37861