I have a page with a datagrid that has several records. I have added a command column that has a custom button. The button navigates to a details page for the selected record. On the details page, I have the page directive set as : @page "/details/{Id:int}"
In the @code section I have a parameter: public int Id { get; set;}
When I have only one textbox, it populates fine. But when I add additional textboxes for the rest of the fields, none of the boxes are populated.
@code
{
[Parameter]
public int Id { get; set;}
Contact contact = new Contact();
protected override async Task OnInitializedAsync()
{
contact = await contactService.GetContactByIdAsync(Id);
}
That is how my code looks in the details page. Each textbox is bound by using: @bind-Value="@contact.FirstName", with their respective field names.
With a single textbox, it works. When I add additional textboxes, nothing populates.
Please help