Building Applications using ASP.NET and C# / Session 4 / 1 of 15 Session 4.

Slides:



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

Individual Bidder Enrollment
Password Reset Instructions PART 1 The following set-up tasks must be performed first in order to use the Automated Password Reset feature. 1.Log into.
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.
Tutorial 14 Working with Forms and Regular Expressions.
ASP.NET Validating user input Validating user input on the client and/or server side 1ASP.NET Validating User Input.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Module 7: Validating User Input.
.NET Validation Controls MacDonald Ch. 8 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
Tutorial 14 Working with Forms and Regular Expressions.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Telerik Software Academy ASP.NET Web Forms Data Validation, Data Validators, Validation Groups Telerik Software Academy
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Christopher M. Pascucci.NET Programming: Forms & Controls.
1 ASP.NET ASP.NET Rina Zviel-Girshin Lecture 3. 2 Overview Cookies Validation controls Client and server side validation Validation control examples.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media.
WEB PRICING SYSTEM User Manual. Click here to Log In The Defense Commissary Agency Vendor Price Change system is located at
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
BIT 285: ( Web) Application Programming Lecture 08: Thursday, January 29, 2015 Data Validation, Using Validators Instructor: Craig Duckett.
Validation and Rich controls 1www.tech.findforinfo.com.
Microsoft Visual Basic 2008 CHAPTER SEVEN Creating Web Applications.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 3.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
ASP.NET Event Handlers Database -> Browser ->Shopping Basket Validators.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
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.
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
XP Tutorial 8 Adding Interactivity with ActionScript.
CSCI 4230 Homework #3 Group Three Samer Al Jefri * Kevin Odom * David Hood * JD * Phil.
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.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Validation using Regular Expressions. Regular Expression Instead of asking if user input has some particular value, sometimes you want to know if it follows.
Vijayalakshmi G M Validation Controls.
Password Reset Instructions PART 1 The following set-up tasks must be performed first in order to use the Automated Password Reset feature. 1.Log into.
CIS 375—Web App Dev II ASP.NET 4 Server Controls.
ASP + JavaScript Client and Server scripts. Link 1 function MyClick(){ document.write("MyClick"); } function MyFunction1(){ alert("My Function 1"); }
Form Validation. Create a form for the user to enter the data seen blow.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
XP Tutorial 7 New Perspectives on JavaScript, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Step 1of 11 Admin Demonstrations Click Here to Start.
Beginning ASP.NET in C# and VB Chapter 9
Tutorial 6 Creating a Web Form
ASP.NET Part 2 Instructor: Charles Moen CSCI/CINF 4230.
Validation Controls Assist your users with providing the correct type of input for your application Assist your users with providing the correct type of.
Chapter 9 Validating User Input. Objectives What user input is and why it’s important to validate it What ASP.NET has to offer to aid you in validating.
Validation & Rich Controls
Computing with C# and the .NET Framework
Validation Controls, User Controls, Master Pages
© 2016, Mike Murach & Associates, Inc.
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.
Creating Web Applications
Unit 27 - Web Server Scripting
Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline Test-Driving the Security Panel Application.
12/9/2018 Session 9.1 Calendar and Validation Controls Using Sessions
Static and Dynamic Web Pages
ASP.NET.
MIS 3200 – Unit 2.2 Outline What’s the problem with bad data?
Server Controls Validation Controls
.NET Validation Controls
Validation & Rich Controls
Presentation transcript:

Building Applications using ASP.NET and C# / Session 4 / 1 of 15 Session 4

Building Applications using ASP.NET and C# / Session 4 / 2 of 15 Session Objectives Explore the various Validation Controls Explain code behind Implement code behind

Building Applications using ASP.NET and C# / Session 4 / 3 of 15 Validation Controls Restricts blank field Compares two fields Checks for specified range Checks value with expression Checks value by client-side or server-side function Lists validation errors of all controls on the page

Building Applications using ASP.NET and C# / Session 4 / 4 of 15 No value is entered Inline error message The User Id cannot be left Blank! The User Id cannot be left Blank! RequiredFieldValid ator

Building Applications using ASP.NET and C# / Session 4 / 5 of 15 Dynamic Display Validation Error Message

Building Applications using ASP.NET and C# / Session 4 / 6 of 15 <asp:comparevalidator controltovalidate="pwd_con" display="static" errormessage="the confirmation password does not match." controltocompare="pwd" type="String" operator="Equal" runat=server> * <asp:comparevalidator controltovalidate="pwd_con" display="static" errormessage="the confirmation password does not match." controltocompare="pwd" type="String" operator="Equal" runat=server> * <asp:comparevalidator controltovalidate="bid" display="static" errormessage="You cannot enter a bid for lesser than $100.“ valuetocompare=100 type="Integer" operator="GreaterThanEqual" runat="server">* <asp:comparevalidator controltovalidate="bid" display="static" errormessage="You cannot enter a bid for lesser than $100.“ valuetocompare=100 type="Integer" operator="GreaterThanEqual" runat="server">* String, Integer, DateTime, Currency, Double =,, =, Not Equal Comparing with static value, 100 CompareVal idator

Building Applications using ASP.NET and C# / Session 4 / 7 of 15 <asp:rangevalidator controltovalidate="r3" type="Integer" minimumvalue="1" maximumvalue="99" errormessage="Your age must be in the range of 1-99 yrs" display="static" runat="server" > * <asp:rangevalidator controltovalidate="r3" type="Integer" minimumvalue="1" maximumvalue="99" errormessage="Your age must be in the range of 1-99 yrs" display="static" runat="server" > * <asp:rangevalidator controltovalidate="r4" type="Integer" minimumcontrol="r1" maximumcontrol="r2" errormessage="Your age must be in the range of 1-99 yrs" display="static" runat="server" > * <asp:rangevalidator controltovalidate="r4" type="Integer" minimumcontrol="r1" maximumcontrol="r2" errormessage="Your age must be in the range of 1-99 yrs" display="static" runat="server" > * Specify value of the control for the range Specify name of the control for the range RangeValid ator

Building Applications using ASP.NET and C# / Session 4 / 8 of 15 SignMeaning ^ The caret sign ^ specifies that checking starts from here $ The “$” sign specifies that the checking ends here [] Square brackets “[]” checks that the value entered match with any of the characters that are in the square brackets. \w “\w” allows any value to be entered /d{} “/d” specifies that the value entered is a digit and {} specifies the number of occurrences of the specified data type +The + sign indicates that one or more elements to be added to the expression being checked RegularExpressionVali dator - 1

Building Applications using ASP.NET and C# / Session 4 / 9 of 15 <asp:regularexpressionvalidator controltovalidate=" id" display="static" ]+\.(com|net|org|edu|mil)$" runat=server> Not a valid address Validate an id RegularExpressionVali dator - 2

Building Applications using ASP.NET and C# / Session 4 / 10 of 15 <asp:customvalidator runat="server" controltovalidate="grade" clientvalidationfunction="clval" onservervalidate="serval" display="static"> Wrong value <asp:customvalidator runat="server" controltovalidate="grade" clientvalidationfunction="clval" onservervalidate="serval" display="static"> Wrong value Client-side function CustomVali dator

Building Applications using ASP.NET and C# / Session 4 / 11 of 15 ValidationSu mmary

Building Applications using ASP.NET and C# / Session 4 / 12 of 15 Page.IsValid Property void validate_page(Object Src, EventArgs E){ if (Page.IsValid == true) { lbl.Text = "Page is Valid!";} else { lbl.Text = "Page is not Valid!";} }

Building Applications using ASP.NET and C# / Session 4 / 13 of 15 disable client-side validation Uplevel and Downlevel Browsers

Building Applications using ASP.NET and C# / Session 4 / 14 of 15 Provides the functionality Code Behind - 1

Building Applications using ASP.NET and C# / Session 4 / 15 of 15 using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public class codeb: Page { public System.Web.UI.WebControls.Label lb1; public System.Web.UI.WebControls.Button bMe; protected void bMe_Click(Object sender, EventArgs e) { lb1.Text = "Clicked!"; } void Main() { } using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public class codeb: Page { public System.Web.UI.WebControls.Label lb1; public System.Web.UI.WebControls.Button bMe; protected void bMe_Click(Object sender, EventArgs e) { lb1.Text = "Clicked!"; } void Main() { } BIN Code Behind - 2