i am using mvc4 and their is problem in dropdown list can you check please

Total Post:2

Points:14
Mvc4 
 734  View(s)
Ratings:
Rate this:
     public ActionResult Index(string searchstring, string search,string dept)
        {
   var DesigList = new List();
            var desigQuery = from d in db.students
                             orderby d.dept
                             select d.dept;
            DesigList.AddRange(desigQuery.Distinct());
            ViewBag.Desig = new SelectList(DesigList);

            if (!String.IsNullOrEmpty(dept))
            {
                contact = contact.Where(x => x.dept == dept);
            }
            return View(contact);
        }
and this is Index.view
 @using (Html.BeginForm())
    {
    <p>
        FirstName: @Html.TextBox("searchstring") &nbsp;   Lastname:  @Html.TextBox("search") &nbsp; DEPT: @Html.DropDownList("dept","All")
        <input type="submit" value="Search" />
    </p>
    }
   

Answer