I’m new to MVC. I’ve got this all working nicely except when the page loads the checkbox is not set to the value of the object from the model. I am certainly missing something simple – hope you can point it out to me.
I’m using a ViewModel class for the view, so my view page has this code:
<%: Html.CheckBox("IsX", Model.Contact.IsX) %>
I’ve been looking through the available overloads but just can’t figure out what I need to put in there…
Any help greatly appreciated.
Tim.
Silly question, are you returning the viewmodel from the action?
eg
Also, in my code, I use the following syntax: