How to validate the input property in Asp.Net MVC ?

Posted by Goud.Kv under ASP.NET MVC category on | Points: 40 | Views : 1812
Simple, Below code snippet helps you to achieve easy validation to your input property of a View.

In Model class of your application,

public class myModel {

public string EmbedCode { get; set; }


The above attribute '[Required]' is used to validate the specified property.
So, User must need to give the EmbedCode in the above example as it is validated.

Comments or Responses

Login to post response