I have a question on MVC ?
I created Model and also create html page using HTML tag Now I want to validate that page using That Model ...?
so how to validate html page (simple html tag )using model in mvc ?
Model:-
public partial class contactu
{
public int Id { get; set; }
[Required(ErrorMessage = "please provide First Name", AllowEmptyStrings = false)]
[AllowHtml]
public string Name { get; set; }
public string Address { get; set; }
[DataType(DataType.EmailAddress)]
[Required(ErrorMessage = "Please enter correct email address")]
public string Email { get; set; }
public string PhoneNo { get; set; }
public string Subject { get; set; }
public string Msg { get; set; }
}
Html Page :-
@**@
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Lida WengPosted Jun 2, 2016, 8:55 AM
Dr.Ajay KashyapPosted Jun 2, 2016, 8:25 AM
Lida WengPosted Jun 2, 2016, 7:25 AM