Linked

Docs

Combo boxes can be linked together using the AddLinkedControl so that selecting an option in a parent control will automatically trigger the loading of options in the linked control. This is achieved by specifying the ForeignKeyColumn in the linked control which is matched against the selected value in the parent control. Adding EmptyOptionText will require the user to make a selection before the child control is loaded rather than automatically.

Artist
Album
Track
Razor
                                
                                        
    DbNetComboCore tracksCombo = new DbNetComboCore("chinook", "tracks", "trackid", "name", "tracks") { ForeignKeyColumn = "albumid", EmptyOptionText = "Please select a track ..." };
    DbNetComboCore albumsCombo = new DbNetComboCore("chinook", "albums", "albumid", "title", "albums") { ForeignKeyColumn = "artistid", EmptyOptionText = "Please select an album ..." };
    DbNetComboCore artistsCombo = new DbNetComboCore("chinook", "artists", "artistid", "name", "artists") { EmptyOptionText = "Please select an artist ..." };
    albumsCombo.AddLinkedControl(tracksCombo);
    artistsCombo.AddLinkedControl(albumsCombo);
    @artistsCombo.Render()