1.单值
cs
public ActionResult Authority() { int targetId = int.Parse(Request.QueryString["id"]);//接收id ViewBag.targetId = targetId; return View(); }
cshtml
2.list
cs
public ActionResult Index() { DDLCompany ddlCompany=new DDLCompany(); IEnumerablecompanyList = ddlCompany.BuildCompanyDDL(); ViewBag.companyList = companyList; return View(); }
cshtml