When you are binding to a parameter, it's expecting an EventCallback parameter to exist that follows the expected naming convention (ends with Changed). So, it's expecting a parameter named "valorcitoChanged". Check out this link for an example using Year that is binding to an int. https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-7.0#binding-with-component-parameters
Custom component does not have a property matching the name
Hello, I'm trying to create a component to use it throughout my project, but I'm encountering the following error:
Error: System.InvalidOperationException: Object of type 'EOS_BLZ.Shared.Controles.CrfTextBox' does not have a property matching the name 'valorcitoChanged'.
The page doesn't load.
I'm attaching the code for the two components.
Custom component:
@using Radzen
@code {
[Parameter] public string Text { get; set; }
[Parameter] public string Name { get; set; }
[Parameter] public int MaxLength { get; set; }
[Parameter] public string Style { get; set; }
[Parameter] public string BindValue { get; set; }
[Parameter] public string valorcito { get; set; }
private RadzenTextBox Txt;
}
Test Component:
@page "/test"
@using EOS_BLZ.Shared.Controles;
<CrfTextBox @ref="crfTextBox" Text="Placa" MaxLength="10" Style="height:60%" @bind-valorcito="@txtValue">
Valor del TextBox: @txtValue
@code {
private CrfTextBox crfTextBox;
private string txtValue = "hello";
}
Thx
0 Posted 193 days ago by selliott