I am using a checkboxlist helper and dynamically binding it..Now i want to maintain the state of checkboxes?
public ActionResult Step3()
{
CustomerQuestion _Cust = new CustomerQuestion();
//Retrieve the answer from database by siteid
var Questions = QAService.GetAllAnswer(1);
var Questionscount = QAService.GetAllAnswer(1).Count();
_Cust.Question18 = Questions.Where(s => s.QuestionID == 18);
return View(_Cust);
}
and here is the view
<%= Html.CheckBoxList("Question18", new SelectList(Model.Question18, "AnswerID", "Answer"))%>