Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4011

onChange event not firing Blazor InputSelect

$
0
0

I have the following Code for an InputSelect

<InputSelect class="form-control form-control form-control-sm"                             placeholder="Role"                             disabled="@IsReadOnly"                             @bind-Value="Model.Role"                              @onchange="@RoleChanged"><option value="Member">Member</option><option value="Admin">Admin</option><option value="Pioner">Pioneer</option><option value="Retailer">Retailer</option></InputSelect>

And for the Code:

bool ShowCreated;bool ShowUpdated;bool IsReadOnly;string SelectedRole;public EditForm AccountForm;public Multi.Dtos.RegistrationDto Model = new Dtos.RegistrationDto() { Role = "Member" };public void RoleChanged(ChangeEventArgs e){    SelectedRole = e.Value.ToString();    Console.WriteLine(e.Value);}

The RoleChange function is not invoked when i try to select a new item. Can someone point out what wrong with this. The value of the proper has changed but the Event was not called.


Viewing all articles
Browse latest Browse all 4011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>