我的下拉列表中有四个部门,我希望它类似,当我在下拉列表中选择所需项目时,它应该打开该部门的注册表单。
<div class="form-group string department">
<label class="control-label col-md-3>
Select Department
</label>
<div class="col-md-4">
@{
List<SelectListItem> deplist = new List<SelectListItem>();
deplist.Add(new SelectListItem { Value = "1", Text = "Department A" });
deplist.Add(new SelectListItem { Value = "2", Text = "Department B" });
deplist.Add(new SelectListItem { Value = "3", Text = "Department C" });
deplist.Add(new SelectListItem { Value = "4", Text = "Department D" });
}
@Html.DropDownListFor(m => m.Department, deplist, "--Select Department -", new { @class = "form-control" })
</div>
我的观点是这样的 DOP部门
<div class="panel-body">
<div class="form-group string required patient_regno">
<label class="control-label col-md-2">
Regestration No
</label>
<div class="col-md-3">
@Html.TextBoxFor(m => m.RegistrationNo, new { placeholder = "BX1234", @class = "string required form-control" })
@Html.ValidationMessageFor(m => m.RegistrationNo, null, new { @class = "text-error" })
</div>
<div class="form-group string required patient_regdate">
<label class="control-label col-sm-2">
Date</label>
<div class="col-md-3">
@Html.TextBoxFor(m => m.RegistrationDate, new{@class="string required form-control", type="date"})
@Html.ValidationMessageFor(m => m.RegistrationDate, null, new { @class = "text-error" })</div>
</div>
</div>
其他部门是DOT
<div class="panel-body">
<div class="form-group string patient_onsetdate">
<label class="control-label col-md-2">
Onset Date
</label>
<div class="col-md-3">
@Html.TextBoxFor(m => m.OnsetDate, new { @class = "string form-control", type = "date", size = "50" })
</div>
<div class="form-group patient_onset">
<label class="control-label col-sm-2">
Onset Place</label>
<div class="col-md-3">
@Html.TextBoxFor(m => m.OnsetAt, new { @class = "string form-control", placeholder = "Place", type = "text" })
</div>
</div>
我为不同的部门创建了视图,当我从DropDownList中选择一个项目时,如何在当前视图中将它们作为表单打开?