我有以下下拉列表:
<select id="coursedd" name="courseid" style="height:40px; font-size:18px;">
<option value="0" id ="defaultcid" class ="choosefilter" >----Please Select Course----</option>
@foreach (var course in Model.GetCourseList())
{
<option value="@course.CourseID" id ="courseid" class ="choosefilter" >@course.Name </option>
}
</select>
当从此下拉列表中选择某些内容时,我想在第二个下拉列表中填充与第一个下拉列表中所选项目相关的信息。如何检索第一个下拉列表中选定索引的值并将其传递给 GetCourseSectionByCourseID() 方法,如下所示:
<select id="coursesectiondd" name="coursesectionid" style="height:40px; font-size:18px;">
<option value="null" id ="defaultcs" class ="choosefilter" >----Please Select Course Section----</option>
@foreach (var courseSection in Model.GetCourseSectionsByCourseID(**??**))
{
<option value="@courseSection.CourseSectionID" id ="coursesectionid" class ="choosefilter" >@courseSection.Title </option>
}
</select>