-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Will the Bind syntax allow us to bind to objects instead of just primitive types. It throws an error
"Error: System.ArgumentException: 'bind' does not accept values of type WebApplication1.Pages.Customer. To read and write this value type, wrap it in a property of type string with suitable getters and setters."
Here is my code
<select class="form-control" bind="SelectedCustomer">
@foreach(var item in Customers)
{
<option value="@item">@item.Name</option>
}
</select>
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components