SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Module 7: Validating User Input
Overview ,[object Object],[object Object],[object Object]
Lesson:  Overview of User Input Validation ,[object Object],[object Object],[object Object]
What Is Input Validation? ,[object Object],[object Object],[object Object]
Client-Side and Server-Side Validation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Valid? Valid? User Enters  Data No No Yes Yes Error  Message Client Server Web Application Processed
ASP.NET Validation Controls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Lesson:  Using Validation Controls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Adding Validation Controls to a Web Form ,[object Object],[object Object],[object Object],<asp: Type_of_Validator   id=&quot; Validator_id &quot; runat=&quot;server&quot; ControlToValidate=&quot; txtName &quot; ErrorMessage=&quot; Message_for_error_summary &quot; Display=&quot; static|dynamic|none &quot; Text=&quot; Text_to_display_by_input_control &quot;> </asp: Type_of_Validator> <asp:TextBox id=&quot; txtName &quot; runat=&quot;server&quot; /> 1 2 3
Positioning Validation Controls on a Web Form ,[object Object],[object Object],[object Object],[object Object]
Combining Validation Controls ,[object Object],[object Object]
Input Validation Controls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Code Examples
Using the RegularExpressionValidator Control ,[object Object],[object Object],[object Object],[object Object],[object Object],<asp:RegularExpressionValidator … ControlToValidate=&quot; US_PhoneNumber &quot;… ValidationExpression=&quot; (({3} ?)|({3}-))?{3}-{4}  &quot; … >*</asp:RegularExpressionValidator > Code Example
Demonstration: Using Validation Controls ,[object Object],[object Object],[object Object],[object Object]
Using the CustomValidator Control ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Code Example
Demonstration: Using the CustomValidator Control ,[object Object],[object Object],[object Object],[object Object]
Lesson: Page  Validation  ,[object Object],[object Object],[object Object]
Using the Page.IsValid Property ,[object Object],Sub cmdSubmit_Click(s As Object, e As EventArgs) If Page.IsValid Then Message.Text = &quot;Page is valid!&quot; ' Perform database updates or other logic here  End If End Sub private void cmdSubmit_Click(object s, System.EventArgs e) { if (Page.IsValid) { Message.Text = &quot;Page is Valid!&quot;; // Perform database updates or other logic here } }
Using the ValidationSummary Control ,[object Object],[object Object],[object Object],<asp:ValidationSummary id=&quot;valSummary&quot; runat=&quot;server&quot; HeaderText=&quot;These errors were found:&quot; ShowSummary=&quot;True&quot;  DisplayMode=&quot;List&quot;/>
Demonstration: Using the Page.IsValid Property and the ValidationSummary Control ,[object Object],[object Object],[object Object]
Review ,[object Object],[object Object],[object Object]
Lab 7: Validating User Input Medical Medical.aspx Benefits Home Page Default.aspx Life Insurance Life.aspx Retirement Retirement.aspx Dental Dental.aspx Dentists Doctors Doctors.aspx  Doctors Logon Page Login.aspx Registration Register.aspx Coho Winery Prospectus Prospectus.aspx XML Web  Service dentalService1.asmx  Page Header Header.ascx ASPState tempdb Lab Web Application User Control namedate.ascx Menu  Component Class1.vb or Class1.cs XML Files Web. config

Weitere ähnliche Inhalte

Was ist angesagt?

ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9Sisir Ghosh
 
Less02 2 e_testermodule_1
Less02 2 e_testermodule_1Less02 2 e_testermodule_1
Less02 2 e_testermodule_1Suresh Mishra
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6Sisir Ghosh
 
Cloud Testing with Browser & Web Service using test injection technique
Cloud Testing with Browser & Web Service using test injection techniqueCloud Testing with Browser & Web Service using test injection technique
Cloud Testing with Browser & Web Service using test injection techniqueCloudtest Software
 
Matlab to vhdl
Matlab to vhdlMatlab to vhdl
Matlab to vhdlsumalama
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yomichael
 
Inside ASP.NET MVC framework
Inside ASP.NET MVC frameworkInside ASP.NET MVC framework
Inside ASP.NET MVC frameworkCiklum Ukraine
 
Inside asp.net mvc framework
Inside asp.net mvc frameworkInside asp.net mvc framework
Inside asp.net mvc frameworkCiklum Ukraine
 
Less14 3 e_loadmodule_4
Less14 3 e_loadmodule_4Less14 3 e_loadmodule_4
Less14 3 e_loadmodule_4Suresh Mishra
 
Less07 2 e_testermodule_6
Less07 2 e_testermodule_6Less07 2 e_testermodule_6
Less07 2 e_testermodule_6Suresh Mishra
 
ASP.NET Session 5
ASP.NET Session 5ASP.NET Session 5
ASP.NET Session 5Sisir Ghosh
 
PPP03 - Complex Preventive Maintenance Procedures
PPP03 - Complex Preventive Maintenance Procedures PPP03 - Complex Preventive Maintenance Procedures
PPP03 - Complex Preventive Maintenance Procedures Maintenance Connection
 
Web Service Testing using TestComplete
Web Service Testing using TestCompleteWeb Service Testing using TestComplete
Web Service Testing using TestCompletesrivinayak
 

Was ist angesagt? (18)

2310 b 17
2310 b 172310 b 17
2310 b 17
 
ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9
 
Less02 2 e_testermodule_1
Less02 2 e_testermodule_1Less02 2 e_testermodule_1
Less02 2 e_testermodule_1
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6
 
Cloud Testing with Browser & Web Service using test injection technique
Cloud Testing with Browser & Web Service using test injection techniqueCloud Testing with Browser & Web Service using test injection technique
Cloud Testing with Browser & Web Service using test injection technique
 
Matlab to vhdl
Matlab to vhdlMatlab to vhdl
Matlab to vhdl
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yo
 
Dev308
Dev308Dev308
Dev308
 
Controls
ControlsControls
Controls
 
Inside ASP.NET MVC framework
Inside ASP.NET MVC frameworkInside ASP.NET MVC framework
Inside ASP.NET MVC framework
 
Inside asp.net mvc framework
Inside asp.net mvc frameworkInside asp.net mvc framework
Inside asp.net mvc framework
 
Less14 3 e_loadmodule_4
Less14 3 e_loadmodule_4Less14 3 e_loadmodule_4
Less14 3 e_loadmodule_4
 
Less07 2 e_testermodule_6
Less07 2 e_testermodule_6Less07 2 e_testermodule_6
Less07 2 e_testermodule_6
 
ASP.NET Session 5
ASP.NET Session 5ASP.NET Session 5
ASP.NET Session 5
 
PPP03 - Complex Preventive Maintenance Procedures
PPP03 - Complex Preventive Maintenance Procedures PPP03 - Complex Preventive Maintenance Procedures
PPP03 - Complex Preventive Maintenance Procedures
 
Web Service Testing using TestComplete
Web Service Testing using TestCompleteWeb Service Testing using TestComplete
Web Service Testing using TestComplete
 
Step types
Step typesStep types
Step types
 
Command object
Command objectCommand object
Command object
 

Ähnlich wie 2310 b 07

Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controlsGuddu gupta
 
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptxvnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptxYamunaS38
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in aspShishir Jain
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls pptIblesoft
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.netDeep Patel
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)let's go to study
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10Sisir Ghosh
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
 
Validation in asp.net
Validation in asp.netValidation in asp.net
Validation in asp.netSireesh K
 
validation-controls.pdf ioue8n uoh souu o3i
validation-controls.pdf ioue8n uoh souu  o3ivalidation-controls.pdf ioue8n uoh souu  o3i
validation-controls.pdf ioue8n uoh souu o3iCoRRexGaMing
 
Mastering Assertions in Automation Testing, Importance and Best Practices.pdf
Mastering Assertions in Automation Testing, Importance and Best Practices.pdfMastering Assertions in Automation Testing, Importance and Best Practices.pdf
Mastering Assertions in Automation Testing, Importance and Best Practices.pdfpcloudy2
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScriptRavi Bhadauria
 
ASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationEyal Vardi
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSunpawet Somsin
 
AJAX ASP.Net
AJAX ASP.NetAJAX ASP.Net
AJAX ASP.NetSHC
 

Ähnlich wie 2310 b 07 (20)

Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptxvnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1.pptx
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Chapter 3 (validation control)
Chapter 3 (validation control)Chapter 3 (validation control)
Chapter 3 (validation control)
 
Validation controls ASP .NET
Validation controls ASP .NETValidation controls ASP .NET
Validation controls ASP .NET
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
2310 b 04
2310 b 042310 b 04
2310 b 04
 
Web controls
Web controlsWeb controls
Web controls
 
Validation in asp.net
Validation in asp.netValidation in asp.net
Validation in asp.net
 
validation-controls.pdf ioue8n uoh souu o3i
validation-controls.pdf ioue8n uoh souu  o3ivalidation-controls.pdf ioue8n uoh souu  o3i
validation-controls.pdf ioue8n uoh souu o3i
 
validation
validationvalidation
validation
 
Mastering Assertions in Automation Testing, Importance and Best Practices.pdf
Mastering Assertions in Automation Testing, Importance and Best Practices.pdfMastering Assertions in Automation Testing, Importance and Best Practices.pdf
Mastering Assertions in Automation Testing, Importance and Best Practices.pdf
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
ASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 Validation
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
AJAX ASP.Net
AJAX ASP.NetAJAX ASP.Net
AJAX ASP.Net
 

Mehr von Krazy Koder (20)

2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xc
2310 b xc2310 b xc
2310 b xc
 
2310 b xb
2310 b xb2310 b xb
2310 b xb
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 14
2310 b 142310 b 14
2310 b 14
 
2310 b 13
2310 b 132310 b 13
2310 b 13
 
2310 b 10
2310 b 102310 b 10
2310 b 10
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 03
2310 b 032310 b 03
2310 b 03
 
2310 b 02
2310 b 022310 b 02
2310 b 02
 
2310 b 01
2310 b 012310 b 01
2310 b 01
 
2310 b 01
2310 b 012310 b 01
2310 b 01
 
Android stepbystep
Android stepbystepAndroid stepbystep
Android stepbystep
 
Android security
Android securityAndroid security
Android security
 

2310 b 07

  • 1. Module 7: Validating User Input
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Lab 7: Validating User Input Medical Medical.aspx Benefits Home Page Default.aspx Life Insurance Life.aspx Retirement Retirement.aspx Dental Dental.aspx Dentists Doctors Doctors.aspx Doctors Logon Page Login.aspx Registration Register.aspx Coho Winery Prospectus Prospectus.aspx XML Web Service dentalService1.asmx Page Header Header.ascx ASPState tempdb Lab Web Application User Control namedate.ascx Menu Component Class1.vb or Class1.cs XML Files Web. config