Greetings, I have a class called Cv (Currículum vitae) and apart from the typical properties: Name, Surname, DNI ... it also contains a property "Driving licenses" which is a list of objects of the class "Driving licenses". Where do I have to generate the list and fill it out? I had thought within the Razor view itself (with strong typing), because in the end it is to generate some checboxs with each one of the cards. CODE:
Class clsCV:
[Display(Name = "NIF")]
[Required]
public string NIF { get; set; }
[Display(Name = "Nom")]
public string Nom { get; set; }
public List<clsCarnets> LlistaCarnets; //Lista de carnets la cual tiene un método preparado que me genera la lista y me la devuelve
//Resto de propiedades
Controller:
public class CVController : Controller
{
// GET: CV
[HttpGet]
public ActionResult CV()
{
return View();
}
}
View (where you receive the strong typing of the clsCV class (currívulum vitae):
@model CurriculumVitaeMVC.Models.clsCv
@{
Layout = null;
}
// Aquí formulario muy extenso con tipado fuerte --> Textboxfor, textareafor, etc... etc...