开发者

What is the use case of the generic ViewMasterPage<T>?

开发者 https://www.devze.com 2022-12-25 06:54 出处:网络
In ASP.NET MVC ther开发者_如何学JAVAe are generic master views (ViewMaserPage<T>). But what is the purpose of them? As I see it, generic argument of master view and \"slave\" view must be equal

In ASP.NET MVC ther开发者_如何学JAVAe are generic master views (ViewMaserPage<T>). But what is the purpose of them? As I see it, generic argument of master view and "slave" view must be equal and this constraints me to using the same model for all my views.


You have abstract BaseViewModel which contain for example properties Title, Description, Keywords, ..., and all other view model classes inherits from BaseViewModel.


You can probably use a base type for your model as the generic argument for your master page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号