var DepNames = (from n in DataContext.HrDepts select new { n.DeptID, n.DeptName }).Distinct(); ViewData["DeptName"] = new SelectList(DepNames, "DeptID", "DeptName", EmployeeValues.FirstOrDefault().DeptName);
@using EmployeeAttendance_app.Models @model IEnumerable<GetEmployeeEditDetails_SpResult> @{ var Item = Model.FirstOrDefault(); } @Html.DropDownList("DeptID", (SelectList)ViewData["DeptName"])
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)