mam wyboru w moim formularzu
asp.net mvc @ Html.CheckBoxFor
I dodanych w moim modelu
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace CorePartners_Site2.Models
{
public class CareerForm
{
//....
public List<CheckBoxes> EmploymentType { get; set; }
}
}
public class CheckBoxes
{
public string Text { get; set; }
public bool Checked { get; set; }
}
i dodał na moim formularzu
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_1" })
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_2" })
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_3" })
ale Pomyśl o błędzie:
Co jest nie tak?
Czy muszę dodawać, że kod w moim formularzu? – Heidel
@Heidel Tak wewnątrz twojego formularza – mattytommo
Próbowałem, ale mam to [http://i.imgur.com/Q78xcBD.png](http://i.imgur.com/Q78xcBD.png). Co jest nie tak? – Heidel