简体   繁体   English

共享视图演示模式?

[英]Sharing view presentation mode?

I am building an ASP .NET MVC 3 application, and I want to make sure that I am following the MVC guidelines as well as possible. 我正在构建一个ASP .NET MVC 3应用程序,我想确保我尽可能遵循MVC指南。

I have a front page that displays a list of computer games. 我有一个显示电脑游戏列表的首页。 Now, it has the same way of displaying the items as another page. 现在,它具有将项目显示为另一页面的相同方式。 How would I do this through an MVC perspective? 我将如何通过MVC视角来做到这一点?

Would I have a function in my controller that returns a string containing the HTML of the list of games, and then print that out on both pages? 我的控制器中是否有一个函数返回一个包含游戏列表HTML的字符串,然后在两个页面上打印出来? Or how would I do this in a proper way? 或者我如何以正确的方式做到这一点?

partial views. 部分观点。 you should be able to find a lot of information about them via search. 你应该能够通过搜索找到很多关于它们的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM