I develop a project on ASP.NET Core 1.1 and I have the following problem: I have a form with which I create a new student, this student has a property that is a list of goals. What I want is to add several goals in the same form in which the student is created. I share some code to illustrate the problem:
This would be the model view:
public class StudenViewModel{
public string FirstName {get; set;}
public string LastName {get; set;}
public List<Goal> Goals {get; set;}
}
public Class Goal {
public string Name {get; set;}
public int Priority {get; set;}
}
This would be a fragment of the view
@model StudentViewModel
<form class="form-horizontal ...>
<div class="form-group>
<label asp-for="FirstName"></label>
<input asp-for="FirstName" />
</div>
<div class="form-group>
<label asp-for="LastName"></label>
<input asp-for="LastName" />
</div>
@* Aqui iria el codigo necesario para agregar elementos (metas) a la lista*@
</form>
I know that this can be easily achieved using frameworks frontend , I've even done it before using React , but for this specific project I'd like to achieve it using only HTML , JS , C # .
I appreciate your help, in advance.