Select is not binding
See original GitHub issueI have placed select code on the out-of-box Blazer-Client/Server project’s client for a select control and it is not binding. Note all other control types (textbox, checkbox, etc) on the same page are binding correctly. Is my syntax correct?
To Reproduce
Index.razor file
Index.razor file
@page "/"
<select bind="@testing">
<option value="Unknown">Unknown</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
@functions {
string testing { get; set; } = "Female";
}
### Expected behavior
Female value is showing in select control. Currently Unknown is showing.
### Additional context
Project Type: Blazor Client-Server
Visual Studio 16.1.0 Preview 2
Microsoft.AspNetCore.Blazor 3.0.0-preview4-19216-03
Microsoft.AspNetCore.Blazor.Build 3.0.0-preview4-19216-03
NETStandard.Library 2.0.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
select ngmodel not binding the variable - angular
I think you're missing the use of the ngValue directive here to have the object reflected in the value bound to ngModel ....
Read more >Mat-Select not binding value : r/angular
Mat-Select not binding value. Hi all! I;m trying to create a form where I use mat select: HTML: <ng-template #content let-modal> <div ...
Read more >Angular Select List Value not binding with Static Values
In my case I ran into a problem with static list values binding to a non-string value which caused the binding to effectively...
Read more >ng-model not binding <select> list values in 1.4.rc2 #11890
I have a list of static values that are bound to a list and I'm trying to get the list to display the...
Read more >AngularJS: API: select
HTML select element with AngularJS data-binding. ... To bind the model to a non-string value, you can use one of the following strategies:....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I don’t know if it the
selectbinding is supposed to work with strings/int/etc., but it does work with enums:I see - this is a duplicate of https://github.com/aspnet/AspNetCore/issues/5616, so will close in favour of that one.