Here is my ViewModel
public class VideoViewModel
{
public string Movie { get; set; }
public int Order { get; set; }
public IList<VideoContent> VideoContents { get; set; }
}
How can I pass data from fields in view to controller mapped to my collection in my viewModel?
This code in my view is passing Movie and Order to controller but I can't figure out hos to send the collection too.
@model ViewModels.VideoViewModel
<form method="post">
<div class="form-group">
<label for="movie">Movie</label>
<input type="text" name="Movie" id="movie" class="form-control">
</div>
<div class="form-group">
<label for="order">Order</label>
<input type="text" name="Order" id="order" class="form-control">
</div>
<button type="submit" class="btn btn-primary">Add to database</button>
</form>
Thanks in advance!
/ Kalle