Blazor - Cascading Dropdown Menu On Inputselect Not Loading
I'm trying to load the below table, however, the drop-down menu for the school is not loading. It looks to me like it's null. And I figured that the InputSelect doesn't work with a
Solution 1:
I see the problem yet. In your SchoolDetail your CountryList is null. You don't assign the CountryList by parameter or somewhere else in SchoolDetail from parent object. You must load/create one in SchoolDetail or in inject from SchoolList by parameter a loaded/created list. In JavaScript are (sometimes) created variables in subcode visible. In Blazor/C# you must transport it from one to another.
Here a Example. Change in SchoolDetail
//private List<SchoolModel> SchoolList;
[Parameter] public List<CountryModel> CountryList { get; set; } = null;
And change in SchoolList.
<SchoolDetail SchoolObject="@SchoolObject" CountryList="@YourCountryList" DataChanged="@DataChanged"></SchoolDetail>
I don't see your CountryList there. You must Load or Create one there.
I recommend to write the objects this way, then you will find them later better in the code with one look.
SchoolObject="@SchoolObject"
Post a Comment for "Blazor - Cascading Dropdown Menu On Inputselect Not Loading"