1
I’m doing a professional registration and of course, my View is typed with this Model. But in the register I need to insert Specialization and Type (other 2 different models). These last 2 models need to come as lists and appear in checkboxes within a Select (HTML).
So far I’ve got the following:
public ActionResult Create()
{
ProfessionalSpecializationDAO pSpecializationDAO = new ProfessionalSpecializationDAO();
ViewBag.ListProfessionalSpecialization = pSpecializationDAO.ListProfessionalSpecialization(0);
ProfessionalTypeDAO pTypeDAO = new ProfessionalTypeDAO();
ViewBag.ListProfessionalType = pTypeDAO.ListProfessionalType(0);
return View();
}
View ():
<div class="editor-field">
@{
ViewBag.ProfessionalSpecialization as List<ProfessionalSecialization>;
foreach (var item in ViewBag.ProfessionalSpecialization)
{
Html.CheckBoxFor(modelItem => item.Title);
}
Html.ValidationMessageFor(model => model.IdProfessionalSpecialization);
}
</div>
Probably why this missing reference to the Model ProfessionalSpecialization
. I don’t know how to refer them.
I answered how to make the reference, but what mistake is really giving!?
– Hermes Autran