Answers for "hw to make onchange event in blazor"

0

hw to make onchange event in blazor

@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);
    }
}
Posted by: Guest on August-15-2021
0

hw to make onchange event in blazor

<select onchange=@DoStuff>
    @foreach (var template in templates)
    {
        <option value=@template>@template</option>
    }
</select>
Posted by: Guest on August-15-2021

Browse Popular Code Answers by Language