1.单值

cs

 public ActionResult Authority()
        {
            int targetId = int.Parse(Request.QueryString["id"]);//接收id
            ViewBag.targetId = targetId;
            return View();
        }

cshtml

<input id="UserID" name="UserID" value="@ViewBag.targetId" type="hidden" />

2.list

cs

        public ActionResult Index()
        {
            DDLCompany ddlCompany=new DDLCompany();
            IEnumerable<SelectListItem> companyList = ddlCompany.BuildCompanyDDL();
            ViewBag.companyList = companyList;
            return View();
        }

cshtml

        <div class="fitem">
            <label>公司:&nbsp</label>
            <select class="easyui-combobox" id="company" style="width: 150px" name="company">
                @foreach (SelectListItem com in ViewBag.companyList as IEnumerable<SelectListItem>)
                {
                    <option value="@com.Value">@com.Text</option>
                }
            </select></div>

 

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
  • 2022-01-05
  • 2021-04-12
  • 2022-12-23
相关资源
相似解决方案