Reputation: 43873
I want to do simple things anyone in my web app like Checker.Email(string) which would return true or false after doing some regex or something. But I don't want to make this whole thing myself if one already exists...
Upvotes: 2
Views: 140
Reputation: 28699
You can use Data Annotations. There is a little tutorial at asp.net/mvc. There's also a DataType attribute that will validate an email for you. If use this method, there's xVal by Steve Sanderson which really makes client/server side validation pretty simple.
Upvotes: 0
Reputation: 43094
If you are using ASP.NET then I'd look at the RegularExpressionValidator that's one of the standard .Net Framework controls. Then grab an email regex from www.regexlib.com.
Upvotes: 2
Reputation: 416059
If you're using webforms, there are several ValidationControls you can place on the from, and a slew of third-party controls that use the same system (Inherit BaseValidator or CustomValidator).
Upvotes: 1