Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media.

Slides:



Advertisements
Similar presentations
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Advertisements

Form Validation CS What is form validation?  validation: ensuring that form's values are correct  some types of validation:  preventing blank.
Tutorial 6 Creating a Web Form
Ch3: Introduction to HTML5 part 2 Dr. Abdullah Almutairi ISC 340 Fall 2014.
Asp.NET Core Vaidation Controls. Slide 2 ASP.NET Validation Controls (Introduction) The ASP.NET validation controls can be used to validate data on the.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Tutorial 14 Working with Forms and Regular Expressions.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
ASP.NET Validating user input Validating user input on the client and/or server side 1ASP.NET Validating User Input.
Chapter 7. 2 Objectives You should be able to describe: The string Class Character Manipulation Methods Exception Handling Input Data Validation Namespaces.
ASP.NET Programming with C# and SQL Server First Edition
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Module 7: Validating User Input.
Page: 1 Creating AJAX-Powered Forms with the Dojo Toolkit Presented By: James Harmon Object Training Group, Inc.
.NET Validation Controls MacDonald Ch. 8 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
Telerik Software Academy ASP.NET Web Forms Data Validation, Data Validators, Validation Groups Telerik Software Academy
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
1 ASP.NET ASP.NET Rina Zviel-Girshin Lecture 3. 2 Overview Cookies Validation controls Client and server side validation Validation control examples.
Validation and Rich controls 1www.tech.findforinfo.com.
ASP.NET Programming with C# and SQL Server First Edition Chapter 5 Manipulating Strings with C#
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
ASP.NET Event Handlers Database -> Browser ->Shopping Basket Validators.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Regular Expression (continue) and Cookies. Quick Review What letter values would be included for the following variable, which will be used for validation.
JavaScript and PHP Validation and Error Handling CHAPTER 17.
Lesson 12 Adding Validation To The Movie Database.
BY Sandeep Kumar Gampa.. What is Regular Expression? Regex in.NET Regex Language Elements Examples Regular Expression API How to Test regex in.NET Conclusion.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
When you read a sentence, your mind breaks it into tokens—individual words and punctuation marks that convey meaning. Compilers also perform tokenization.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company ASP.NET Validation Control Presented By : Muhammad Atif Hussain Deputy.
VALIDATION CONTROLS.  Validation Controls are primarily used to validate, or verify the data entered by user into a web form.  Validation controls attempt.
XP Tutorial 8 Adding Interactivity with ActionScript.
Session 6: Validating User Input. Outline Overview of User Input Validation Client-Side and Server-Side Validation ASP.NET Validation Controls Using Validation.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 User Input Validating.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Vijayalakshmi G M Validation Controls.
HTML 5 Form elements Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
XP Tutorial 7 New Perspectives on JavaScript, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Beginning ASP.NET in C# and VB Chapter 9
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Tutorial 6 Creating a Web Form
Using Personalization Creating user profiles Retrieving, changing, and saving profile properties Using validation controls Using the Forms Designer.
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
Lesson 4 String Manipulation. Lesson 4 In many applications you will need to do some kind of manipulation or parsing of strings, whether you are Attempting.
Validation Controls Assist your users with providing the correct type of input for your application Assist your users with providing the correct type of.
ASP.NET Programming with C# and SQL Server First Edition
Standard Operating Procedure
JavaScript, Sixth Edition
Chapter 5 Validating Form Data with JavaScript
© 2016, Mike Murach & Associates, Inc.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser.
The Selection Structure
Chapter 19 PHP Part II Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Working with Forms and Regular Expressions
Unit 27 - Web Server Scripting
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
PART 2.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Matcher functions boolean find() Attempts to find the next subsequence of the input sequence that matches the pattern. boolean lookingAt() Attempts to.
Chapter 7: Input Validation
Lecture 25: Regular Expressions
MIS 3200 – Unit 2.2 Outline What’s the problem with bad data?
.NET Validation Controls
Presentation transcript:

Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media Department Politeknik Brunei VALIDATION ASP C#

Validating User Input with Validation Controls ASP.NET offers validation controls for validating user input Three of the most commonly used validation controls: –RequiredFieldValidator control –CompareValidator control –RegularExpressionValidator control ASP.NET Programming with C# and SQL Server, First Edition2

RequiredFieldValidator Control RequiredFieldValidator control: ensures that a value is entered into a specified field on a Web form – Text property: contains the error message that will appear if the field is empty when the user tries to submit the form – ControlToValidate property: the field that is to be validated ASP.NET Programming with C# and SQL Server, First Edition3

RequiredFieldValidator Control (cont’d.) ASP.NET Programming with C# and SQL Server, First Edition4 Figure 4-10 BMI program with RequiredFieldValidator controls

CompareValidator Control CompareValidator control: verifies that the entered value is a specific data type – Text property: the message to appear if the data type of the entered value is incorrect – ControlToValidate property: the form field to be validated – ControlToCompare property: another field against which the field being validated is to be compared – Type property: the data type that must be used – Operator property: the comparison type to perform – ValueToCompare property: the value to be used in the comparison test ASP.NET Programming with C# and SQL Server, First Edition5

CompareValidator Control (cont’d.) ASP.NET Programming with C# and SQL Server, First Edition6 Table 4-5 Comparison types of the Operator property

RegularExpressionValidator 7 A regular expression is a powerful pattern matching language that can be used to identify simple and complex characters sequence that would otherwise require writing code to perform. Using RegularExpressionValidator server control, you can check a user's input based on a pattern that you define using a regular expression. It is used to validate complex expressions. These expressions can be phone number, address, zip code and many more. Using Regular Expression Validator is very simple. Simply set the ValidationExpression property to any type of expression you want and it will validate it.

Validation Expression 8 FieldExpressionFormat SamplesDescription Name^[a-zA-Z''-'\s]{1,40}$John Doe O'Dell Validates a name. Allows up to 40 uppercase and lowercase characters and a few special characters that are common to some names. You can modify this list. Social Security Number^\d{3}-\d{2}-\d{4}$ Validates the format, type, and length of the supplied input field. The input must consist of 3 numeric characters followed by a dash, then 2 numeric characters followed by a dash, and then 4 numeric characters. Phone Number^[01]?[-.]?(\([2-9]\d{2}\)|[2-9]\d{2})[-.]?\d{3}[-.]?\d{4}$ (425) Validates a U.S. phone number. It must consist of 3 numeric characters, optionally enclosed in parentheses, followed by a set of 3 numeric characters and then a set of 4 numeric characters. !#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a- zA- 9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA- Z]{2,6}))$ an address. URL^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a- zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\- \.\?\,\'\/\\\+&%\$#_]*)?$ a URL

Validation Expression 9 ZIP Code^(\d{5}-\d{4}|\d{5}|\d{9})$|^([a-zA- Z]\d[a-zA-Z] \d[a-zA-Z]\d)$ 12345Validates a U.S. ZIP Code. The code must consist of 5 or 9 numeric characters. Password(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA- Z0-9]{8,10})$ Validates a strong password. It must be between 8 and 10 characters, contain at least one digit and one alphabetic character, and must not contain special characters. Non- negative integer^\d+$0 986 Validates that the field contains an integer greater than zero. Currency (non- negative)^\d+(\.\d\d)?$1.00Validates a positive currency amount. If there is a decimal point, it requires 2 numeric characters after the decimal point. For example, 3.00 is valid but 3.1 is not. Currency (positive or negative)^(-)?\d+(\.\d\d)?$1.20Validates for a positive or negative currency amount. If there is a decimal point, it requires 2 numeric characters after the decimal point.

Validation Webform Sample ASP.NET Programming with C# and SQL Server, First Edition10

Summary ASP.NET Programming with C# and SQL Server, First Edition11 Validation ControlDescription RequiredFieldValidationMakes an input control a required field CompareValidatorCompares the value of one input control to the value of another input control or to a fixed value RangeValidatorChecks that the user enters a value that falls between two values RegularExpressionValidatorEnsures that the value of an input control matches a specified pattern CustomValidatorAllows you to write a method to handle the validation of the value entered ValidationSummaryDisplays a report of all validation errors occurred in a Web page The below table describes the controls and their work:

Contact For Tutorial and Notes Cikguhadi.com Digital Media Department Politeknik Brunei Welcome to WADT