TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sasi Reddy
NA
346
226.9k
Server Side Validations in MVC4 Models
Feb 6 2014 2:28 AM
public partial class NormalRegistration
{
public int Id { get; set; }
[RegularExpression(@"^[a-zA-Z''-'\s]*$", ErrorMessage = "Please Enter valid Name")]
[Required]
[StringLength(50)]
public string Name { get; set; }
[Required(ErrorMessage = "Email_id must not be empty")]
[RegularExpression(".+\\@.+\\..+", ErrorMessage = "Please Enter valid mail id")]
public string Email { get; set; }
}
I am writing validations in models in mvc4 ,i am using regular expressions also.some times are working and sometimes are not working.can you please tell me how to getrid of this problem?
Reply
Answers (
3
)
Hosting and accessing sql server database in windows app
Connecting to Access MS 2013 issue