Using Enteprise Library for request param validation

Topics: Validation Application Block
Jul 11, 2009 at 4:12 PM

Hi.

I am been looking for an example how to validate request param with enteprise library. I was expecting to find it as the first example since this the most common validation need in a web application.

But no luck.

How can i validate
string dangerousValue = Request["dangerousinput"]

I want to use Regexp validation or other type of validation on this.

Thanks
Peakman

 

 

 

 

 

Jul 13, 2009 at 3:19 AM

You could use :

<font size="2" color="#2b91af">

RegexValidator

</font>

regexValidator = new RegexValidator(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");

ValidationResults results = regexValidator.Validate(Request["dangerousInput"]);

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com