Skip to content

Instantly share code, notes, and snippets.

@donhuvy
Forked from SQL-MisterMagoo/sample.cshtml
Created February 16, 2021 01:19
Show Gist options
  • Save donhuvy/30d033361b1f8ff114a39776c1f0fe41 to your computer and use it in GitHub Desktop.
Save donhuvy/30d033361b1f8ff114a39776c1f0fe41 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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment