0
我有兩個dropDownLists:獲取鑑於在運行時的DropDownList的選定值?
@Html.DropDownListFor(model => model.Organization, (SelectList)ViewBag.Organizations)
@Html.DropDownListFor(model=>model.Doctor, (SelectList)ViewBag.Doctors)
選擇列表的從控制器
List<IOkpolu> orgs = _unitOfWork.Organizations.ToList();
ViewBag.Organizations = new SelectList(orgs, "Code", "Name");
List<IDoctor> docs = _unitOfWork.Doctors.GetAll().ToList();
ViewBag.Doctors = new SelectList(docs, "Code", "Name");
我想基於組織機構代碼值加載第二DropDownList的(醫生)在被choosen傳遞在運行時第一個DropDownList。 醫生我有方法,從組織需要醫生:
_unitOfWork.Doctors.GetByOrganization(string organizationCode)
我怎樣才能得到第一個DropDownList選擇的值在運行時,它傳遞給第二個DropDownList的?
非常感謝!