Html select tag - How to populate a field depending on which one I choose in a list view

Helio Viegas 21 Reputation points
2022-06-25T14:43:46.63+00:00

Hi,

I'm looking for a solution to populate the fields related when choice in the list view.

At this moment I choose an option and after refreshing it populates the related fields.
Below my code:

<select asp-for="Property.Prop_Owner_Id" asp-items="@默 .OwnerList" class="form-select">
<option disabled selected>--Select Owner--</option>
</select>
<span asp-validation-for="Property.Prop_Owner_Id" class="text-danger"></span>

And want populate:

<input asp-for="Property.Owner.Own_EMail_1st_Holder" class="form-control" readonly />
<span asp-validation-for="Property.Owner.Own_EMail_1st_Holder" class="text-danger"></span>

Thanks

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,134 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Helio Viegas 21 Reputation points
    2022-06-25T18:14:48.617+00:00

    Thanks for the reply,

    In Razor view pages there is asp-route-id and asp-action, but it only works with the attribute <a>?

    Thank you for your help,
    Hélio Viegas