ASP.NET MVC 中母版页、视图和部分视图中视图模型之间的关系
我刚刚结束了技术面试。面试官问了一个关于与母版页、视图和部分视图相关的模型之间关系的问题,假设视图使用母版页并且视图包含部分视图。
我不明白他的目的是什么。据我了解,视图模型是由程序员提供的,这意味着这种关系是完全灵活的。有人可以帮我吗?我怀疑我的理解缺乏,但我可能完全误解了这个问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
母版页视图模型必须是视图模型的父类或同一类型。
部分视图视图模型可以是视图视图模型的相同类型或属性或从此视图模型构造的任何其他内容。
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.