xxxxxxxxxx
@functions {
List<string> templates = new List<string>() { "Maui", "Hawaii", "Niihau", "Kauai", "Kahoolawe" };
string selectedString = "Maui";
void DoStuff(ChangeEventArgs e)
{
selectedString = e.Value.ToString();
Console.WriteLine("It is definitely: " + selectedString);
}
}
xxxxxxxxxx
<select onchange=@DoStuff>
@foreach (var template in templates)
{
<option value=@template>@template</option>
}
</select>