mercredi 28 janvier 2015

Razor CheckBoxFor model bool variable

I have a razor MVC project, i use TextBoxFor to set the data for the model im posting.


Now im trying to do the same thing for a CheckBox to set a bool value in my model, but it doesnt work.



@Html.CheckBoxFor(model => model.bringYourOwnDevice, new
{
@class = "form-control",
@id = "inputBringyourowndevice",
})

public class RegisterModel
{
bool bringYourOwnDevice { get; set; }
}


What am i doing wrong?





Aucun commentaire:

Enregistrer un commentaire