Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<div class="form-group">
<label>State:</label>
<div>
<InputSelectNumber class="form-control"
@bind-Value="Person.StateId"
>
<option value="0">--Select a state--</option>
@foreach (var item in States)
{
@if (item.Id == Person.StateId)
{
<option selected value="@item.Id">@item.Name</option>
}
else
{
<option value="@item.Id">@item.Name</option>
}
}
</InputSelectNumber>
<ValidationMessage For="@(() => Person.StateId)" />
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.