Hi, the above validations can be done on client side (javascript). On server side, you can use customvalidator.
http://msdn.microsoft.com/en-us/library/f5db6z8k(VS.71).aspx. Regards. On Thu, Mar 19, 2009 at 10:48 AM, rbr <[email protected]> wrote: > > Hello, > > I am looking for a solution for data validation other than forms > validation. I am consuming a number of web services and then map the > XML messages to a DTO. I would like to create a data validation > library that will work across the services. I envision static > functions like the following: > > IsValidString(string) - not empty, not sqlinjection/cross-site, etc. > > IsAlpha(string) - Only contains alpha characters > > IsNumeric(string) - Only contains numeric characters > > IsValidEnum(string, enum) - value is within given enum > > Etc, etc. I have tried to find good examples of best practices for > this kind of validation online. however, all I seem to find are > examples for forms validation. I was hoping for a P & P article or > Application block but could not find either. > > If anybody has any advice or knows of any good articles I would > greatly appreciate it. > > Thanks in advance! > > Ryan >
