Blazor select bind to a value in a list [duplicate]
问题 This question already has answers here : blazor variable argument passing to onclick function (2 answers) Closed last year . I was able to bind an int type (which is the first element of the list SelectedDiagnosisIdList) variable to the selected element of a html select: <div> <label>Diagnosis:</label> <div> <select @bind="@userInfo.SelectedDiagnosisIdList[0]"> @foreach (var item in diagnoses) { <option value="@item.Id">@item.Name</option> } </select> <p>@userInfo.SelectedDiagnosisIdList[0]"<