i am doing a asp net MVC5 web application. I have two model FootballLeague and FootballTeam. I want to be able to create a FootballLeague and its teams in the same view.

My model is like:

public class FootballLeague{
    public virtual ICollection<FootballTeam> teams {get; set;}

and add in the create.cshtml view:

<div class="form-group">
    @Html.EditorFor(model => model.Teams)

I have in Views\Shared\EditorTemplates\FootballTeam.cshtml.

The problem is that the partial view is not shown. Am I missing anything?

There is another way to implement this?

Related posts

Recent Viewed