开发者

The relationship between view models in master pages, views and partial views in ASP.NET MVC

开发者 https://www.devze.com 2023-01-27 10:53 出处:网络
I have just finished 开发者_如何转开发a technical interview. The interviewer asked a question about the relationship between the models associated with a master page, view and partial view, given that

I have just finished 开发者_如何转开发a technical interview. The interviewer asked a question about the relationship between the models associated with a master page, view and partial view, given that the view uses the master and the view contains the partial.

I did not understand what he was driving at. As far as I understood it, view models are supplied by the programmer, meaning the relationship is completely flexible. Can anyone help me out here? I suspect my understanding is lacking, but I may have completely misunderstood the question.


The master page viewmodel must be a parent class or the same type of the view model.

The partialview viewmodel can be the same type or a property of the view viewmodel or anything else constructed from this viewmodel.

0

精彩评论

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

关注公众号