Last post Nov 11, 2011 03:40 PM by imran_ku07
Nov 09, 2011 02:49 AM|nightzeus|LINK
I created an MVC4 Internet app and when I submit a registration with a nonvalid email, the registration was a success.
Is this supposed to do anything because it doesn't seem to be doing anything for me?:
Nov 09, 2011 02:54 AM|bruce (sqlwork.com)|LINK
you need to add the email validation attribute
Nov 09, 2011 03:07 AM|nightzeus|LINK
The attribute is not recognized. Can't find a using to make it work.
Nov 09, 2011 03:47 AM|nightzeus|LINK
Well, I found this link to create the custom Email attribute:
Be nice if it was already built-in.
Nov 09, 2011 08:48 AM|nightzeus|LINK
Ah, I found NuGet package DataAnnotationsExtensions.MVC3 and installed it to my MVC4 app and it works.
Nov 11, 2011 03:40 PM|imran_ku07|LINK
If you are using ASP.NET MVC 4.0 with .NET Framework 4.5 then it include
EmailAddressAttribute. But currently this attribute only works at server side. But I believe client side validation will also work in the future release of ASP.NET MVC 4.0.
In addition to the link you shared, ASP.NET MVC 3 Futures include
EmailAddressAttribute. which works both on client and server side(in case if you are using unobstrusive validation)