Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created December 3, 2019 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/8e5af93f42890f895785abf75d3622e8 to your computer and use it in GitHub Desktop.
Save gavilanch/8e5af93f42890f895785abf75d3622e8 to your computer and use it in GitHub Desktop.
<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