4

Let's say I have a view-models like this:

public class AbonentViewModel
{
    public int? Id { get; set; }
    public string ClientName { get; set; }
    public List<AbonentCertificate> Certificates { get; set; }
}

public class AbonentCertificate
{
    public string Name { get; set; }
    public string FileName { get; set; }
}

I want to write a tag helper which could show list of Certificates using custom html like this:

<multi-list asp-for="Certificates">
    <div class="list-item">
       <input asp-for="Name" />
       <input asp-for="FileName" />
    </div>
</multi-list>

Html inside th multi-list element would be repeated for each certificate object with appropriate values set.

Is there any way to do this?

Tseng
  • 52,202
  • 10
  • 166
  • 183
OssaLtu
  • 49
  • 2

0 Answers0