我有三个剑道下拉列表如下
1)
@(Html.Kendo().DropDownListFor(m => m.ProgrammeID)
.HtmlAttributes(new { data_value_primitive = "true" })
.Name("ProgrammeID")
.DataTextField("DegreeName")
.DataValueField("Id")
.OptionLabel("Select Below...")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetProgramme", "AptitudeTset").Data("filterProgramme");
})
.ServerFiltering(true);
})
.SelectedIndex(0)
.CascadeFrom("FacultyID")
)
2)
@(Html.Kendo().DropDownListFor(m => m.SpecializationID)
.HtmlAttributes(new { data_value_primitive = "true" })
.Name("SpecializationID")
.DataTextField("SpecializationNameID")
.DataValueField("SpecializationID")
.OptionLabel("Select Below...")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetSpecialization", "Subject").Data("filterSpecialization");
})
.ServerFiltering(true);
})
.SelectedIndex(0)
.CascadeFrom("ProgrammeID")
)
3)
@(Html.Kendo().DropDownListFor(m => m.SemesterID)
.HtmlAttributes(new { data_value_primitive = "true" })
.OptionLabel("Select Below...")
.Name("SemesterID")
.DataTextField("SemesterName")
.DataValueField("SemesterID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetSemester", "StudentRSRegistration").Data("loadSemester");
})
.ServerFiltering(true);
})
.SelectedIndex(0)
.CascadeFrom("SpecializationID")
.CascadeFrom("ProgrammeID"`enter code here`)
)
在这里,我的第三个 DDL 负载基于第一个和第二个 DDL。但有时第二个 DDL 可能没有值。它可以是空的。第一个 DDL 总是有值。我的问题是,当第二个 DDL 为空值时,我的第三个 DDL 没有加载。但我想总是加载我的第三个 DDL。因为 SemesterID 是必需的。SemesterID 取决于 programID或/和SpecializationID。这就是为什么有时第二个 DDl 可能有空值的原因。