Skip to content

Instantly share code, notes, and snippets.

@SQL-MisterMagoo
Last active October 31, 2021 18:35
Show Gist options
  • Save SQL-MisterMagoo/bc5713fb26bf84bf810d48d1f45c361a to your computer and use it in GitHub Desktop.
Save SQL-MisterMagoo/bc5713fb26bf84bf810d48d1f45c361a to your computer and use it in GitHub Desktop.
@foreach (var item in new string[] { "AspNetCore","AspNet","SomeJsThingWhatever"})
{
<div>
<input type="radio" name="technology" id="@item" value="@item" @onchange="RadioSelection" checked=@(RadioValue.Equals(item,StringComparison.OrdinalIgnoreCase)) />
<label for="@item">@item</label>
</div>
}
<div>
<label>Selected Value is @RadioValue</label>
</div>
@code
{
string RadioValue = "aspnetcore";
void RadioSelection(ChangeEventArgs args)
{
RadioValue = args.Value.ToString();
}
}
@DesenEnterprises
Copy link

This is awesome, thank you so much! Life saver...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment