ASP.NET MVC剃刀传递模式来布局剃刀、布局、模式、ASP

2023-09-02 21:22:51 作者:生个野种叫回忆

我看到的是一个字符串布局属性。但我怎么能传递一个模型来明确布局?

What I see is a string Layout property. But how can I pass a model to layout explicitly?

推荐答案

好像你已经仿照你的ViewModels有点不对劲,如果你有这个问题。

Seems like you have modeled your viewmodels a bit wrong if you have this problem.

我个人从来没有输入页面布局。但是,如果你想这样做,你应该有一个基础视图模型,你的其他的ViewModels继承并键入布局的基础视图模型,你的页面的具体一次。

Personally I would never type a layout page. But if you want to do that you should have a base viewmodel that your other viewmodels inherits from and type your layout to the base viewmodel and you pages to the specific once.

 
精彩推荐
图片推荐