查看下拉列表

时间:2019-06-24 21:23:31

标签: asp.net-mvc

在做出新选择时,我如何添加一个下拉列表来更新“员工”视图?我想在选择新的下拉记录后自动刷新员工页面。

    public ActionResult Employees(string Department)
    {

        //return View(db.Employees.Where(_ => _.Department == Department).ToList());
        // return View(db.Employees.ToList());
        var employees = from m in db.Employees
                        where m.Department == Department ||Department == null ||Department == ""
                        select m;

        return View(employees.ToList());

0 个答案:

没有答案