Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<div class="form-group">
<label>Country:</label>
<div>
<InputSelectNumber class="form-control"
ValueChanged="@((int value) => CountryHasChanged(value))"
ValueExpression="@(() => countryId)"
Value="@countryId">
<option value="0">--Select a country--</option>
@foreach (var item in Countries)
{
@if (item.Id == countryId)
{
<option selected value="@item.Id">@item.Name</option>
}
else
{
<option value="@item.Id">@item.Name</option>
}
}
</InputSelectNumber>
</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.