Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Extensible Request Validation is a feature of ASP.NET that you could see on the exam because it gives us the ability to control some very serious aspects about working on the web in recent years. So first let's tackle the question, what exactly is Request Validation? Well this is simply the process of checking the data that's coming into the website where our end-user, using a browser is requesting, you know, a file, a web page, that sort of thing from our web browser. Now what we're really checking for and what we're concerned about, is the possibility of cross-site scripting being injected through that request and then we undergo or we experience or suffer a cross-site scripting attack. Now this has become a pretty serious security issue on the web of late and so let's talk exactly about what Extensible Request Validation is. Now before I move on, we're going to talk some more about cross-site scripting alleviation or avoidance or prevention in some other videos later when we talk about HTML and coding as well. So first up, what exactly is Extensible Request Validation? Well it is the ability that you have as a developer in ASP.NET 4 to apply your own customized HTTP Request Data Validation Logic. Now here's the good part about this. Not only are there places in our website that we know is explicitly exposed to the public side of our website and therefore we do want to check those HTTP Requests and we may want to tighten that up some from what's just standard in what's being provided by ASP.NET. So we can apply a much more aggressive validation to some pages. Then there maybe instances where we want to take out some Validation Rule that creates a problem on certain pages and certain activities that we want that are prevented by some of the more aggressive validation rules. Now let's back up just a minute, we're doing this whole Extensible Request Validation to prevent cross-site scripting and I don't want you to be confused here although cross-site scripting gets to be a pretty deep subject. On the bottom line, it is simply the injection of some sort of malicious code onto a website that can then be used to access information in a number of different ways. We can put information on a website so that when the user clicks a link, it sends more information to a different location, there's all just kind of things. There's just many different ways to do cross-site scripting as there are 12 and 13 year olds to create them and code them up and put them out there. Okay. So here's what I'll do. I'll just point you to a resource for more information on cross-site scripting and notice you will usually see this written as XSS, just go to www.CGISecurity.com XSS FAQ.html that's a good place to start and just kind of read up on cross-site scripting. Now this again, it does get pretty deep on you pretty quickly. Now let's go back to Extensible Request Validation. To turn this on and to use this you're going to create a class that derives from or inherits from the new System.Web.Utility.RequestValidatortype. Now obviously System.Web.Utility is a namespace, the RequestValidatortype is the parent class that you're going to inherit from and you can look MSDN for an example of what that class should like and generally how it should be written and then you can tweak it from there. Alright. Then you need to configure your application, your ASP.NET application to use that class that you just created. And the way you're going to do that, you're going to go into the Web.Config file and look at the HTTP Runtime Section and you're just going to add the RequestValidationtype Attribute and then notice here in the quotes you're going to put the name of the class that you built that inherits from RequestValidator. And then at that point, you'll be able to use whatever rules you've written into that class. So Extensible Request Validation, again I'm not going to do an example of this or code it up. I just want you to know what it is, understand how to answer questions on it, just by knowing what it is will probably give you what you need to know on the exam to get around questions where you need to provide more aggressive validation of the request coming into your web server. Watch for key terms like cross-site scripting concerns, you know trying to alleviate cross-site scripting attacks, that sort of thing. So anytime there's that kind of request or requirement on a project, Extensible Request Validation is probably going to be part of the correct answer. So that's the overview of Extensible Request Validation.
| Course: | Designing and Developing ASP.NET 4 Web Apps (Exam 70-519) |
| Author: | Mark Long |
| SKU: | 34292 |
| ISBN: | 978-1-61866-029-9 |
| Release Date: | 2011-12-31 |
| Duration: | 8.5 hrs / 108 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |