Validate DropDownList in ASP.Net MVC

Last Reply on Apr 02, 2014 11:44 PM By Mudassar

Posted on Apr 02, 2014 11:44 PM


I'm filling my dropdown using viewbag like as under

@Html.DropDownList("ArticleType", null, "select", new { @class = "ddl" })

 @Html.ValidationMessageFor(model => model.ArticleType)

[Required(ErrorMessage = "Please enter article category")]
        public string ArticleType { get; set; }

But i'm unable to get required feild error message.Is i'm going wrong?

Thank you.

I agree, here is the link: