jeudi 10 novembre 2016

ASP.NET views and model, a small questions

Dears,

Please could you help me to understand very simple thing

I have model with my class:

public class VendorAssistanceViewModel
{
    public string Name { get; set; }
    public bool Checked { get; set; }
}
public partial class CSModel : IEntity
{
    public CSModel()
    {

        VendorAssistances = new[]
        {
        new VendorAssistanceViewModel { Name = "DJ/BAND" },
        new VendorAssistanceViewModel { Name = "Officiant" },
        new VendorAssistanceViewModel { Name = "Florist" },
        new VendorAssistanceViewModel { Name = "Photographer" },
        new VendorAssistanceViewModel { Name = "Videographer" },
        new VendorAssistanceViewModel { Name = "Transportation" },
        }.ToList();
    }


    public IList VendorAssistances { get; set; }

I have view:

@model IEnumerable<CSTS.Models.CSModel>

  ... some html code...
 and how here to show array of checkboxes from Model, using VendorAssistances ?

I know that this is very simple, I read a lot of docs, but still can not understand

Thank you!

Aucun commentaire:

Enregistrer un commentaire