Q: How to display a validation if dropdownlist value == null in mvc? I'm having trouble in displaying validation message when a null value is selected.
My code for the dropdownlist:
<strong>@Html.ValidationSummary("", new { @class = "text-danger" })</strong>
@Html.DropDownList("Category", null, String.Empty, new { @class = "form-control" })

I understand that String.Empty equals to a null value(Correct me if i'm wrong).
My code for my model:
namespace Mp.Models
{
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;

  public partial class Content
  {
      [Required(ErrorMessage: "A Category is required!")]
      public string Category { get; set; }
  } 
}

