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

hi,

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")]
        [DisplayName("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: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html