0
我的每个视图都需要一个导航栏,它被放置在名为_NavigationPartial的局部视图中。此部分视图使用使用部分视图时忽略原始模型声明?
@model IEnumerable<ProOptInteractive.Models.ProductCategory>
并且此导航栏需要此功能。然而,在一些我的看法,我宣布其他车型,其覆盖在局部视图模型,这让我试图在浏览器中打开这些视图时的错误:我怎样才能设置
@model ProOptInteractive.Models.ProductCategory <!-- this is incompatible! -->
@Html.Partial("_NavigationPartial")
部分视图在我的视图中忽略原始模型声明?
这是令人困惑的b/c偏差不会绑定到父母的模型 –
这是错误:传递到字典中的模型项目类型为'ProOptInteractive.Models.ProductCategory',但此字典需要一个类型为' System.Collections.Generic.IEnumerable'1 [ProOptInteractive.Models.ProductCategory]”。显然他们是绑定的:P –
很奇怪。我知道他们不是因为我每天都使用偏分量。显然需要更多信息,但我不确定... –