Using partial views in ASP.net MVC 4

后端 未结 2 751
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 09:33

I have recently started playing around with ASP.net MVC (4), but I can\'t wrap my head around this one issue I\'m having. I\'m sure it\'s easy when you know it.

I\'m

2条回答
  •  死守一世寂寞
    2020-12-04 09:41

    Change the code where you load the partial view to:

    @Html.Partial("_CreateNote", new QuickNotes.Models.Note())
    

    This is because the partial view is expecting a Note but is getting passed the model of the parent view which is the IEnumerable

提交回复
热议问题