I want to assign some ID attribute name to my Dropdown list which is using data from the ViewBag as,
ViewBag.Group = new SelectList(group, \"GroupId\", \"Nam
You should be using something like this
@Html.DropDownList("Group",null,new{@id="testID"});
because the data for the DropDownList comes from the ViewBag to name Group
Try it:
In controller
ViewBag.EmployeeId = new SelectList(db.tb_employees, "id", "last_name");
In View
@Html.DropDownList("EmployeeId", (IEnumerable<SelectListItem>)ViewBag.EmployeeId,"Show All", new { @class = "form-control" })