hi ,
page having 2 dropdownlist.
i have to collect dropdownlist1 value and pass that value as param to 2nddropdownlist and sent that value to controller to fetch the details
these are kendo dropdownlists.
@(Html.Kendo().DropDownList()
.Name("ddlDropDown2")
.OptionLabel("Select")
.AutoWidth(true)
.AutoBind(false)
.DataTextField("Key")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDetails", "Common");
});
})
.Enable(true)
)
need help
Jayraj ChhayaPosted May 14, 2024, 10:40 AM
To achieve this functionality, you can use jQuery to handle the dynamic values between the two dropdown lists. You can capture the selected value from the first dropdown list and then use it to update the data source of the second dropdown list.
Murali PPosted May 14, 2024, 11:11 AM
Thanks for the reply jayraj..
the second dropdownlist will not be visible always. only for the few values of 1st dropdownlist it will get display.
tried below ways:
declared a variable as
@{
var SelectedCode = "";
}
but how to assign this on changing the first dropdown is facing issues