Description
The original code example to do multiple selection is
<InputSelect @bind-Value="Model!.SelectedClassification">
However, to do multiple section, the InputSelect should add multiple.
That is
<InputSelect @bind-Value="Model!.SelectedClassification" multiple>
Moreover, in the following razor code
@if (Model?.SelectedClassification?.Length > 0)
{
<div>@string.Join(", ", Model.SelectedClassification)</div>
}
That won't make any change if the component is not set InteractiveServer rendermode.
So the redermode should be put at the top of code
@page "/starship-5"
@using System.ComponentModel.DataAnnotations
@inject ILogger<Starship5> Logger
@rendermode InteractiveServer
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/input-components?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/forms/input-components.md
Document ID
52ee411b-69fe-c0bc-5305-846d9384ebbd
Platform Id
ebc8ed08-0e4e-884d-e47b-d27b203d1205
Article author
@guardrex
Metadata
- ID: 52ee411b-69fe-c0bc-5305-846d9384ebbd
- PlatformId: ebc8ed08-0e4e-884d-e47b-d27b203d1205
- Service: aspnet-core
- Sub-service: blazor
Related Issues
Description
The original code example to do multiple selection is
However, to do multiple section, the
InputSelectshould addmultiple.That is
Moreover, in the following razor code
That won't make any change if the component is not set InteractiveServer rendermode.
So the redermode should be put at the top of code
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/input-components?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/forms/input-components.md
Document ID
52ee411b-69fe-c0bc-5305-846d9384ebbd
Platform Id
ebc8ed08-0e4e-884d-e47b-d27b203d1205
Article author
@guardrex
Metadata
Related Issues