查看()主场迎战PartialView() [英] View() vs. PartialView()
问题描述
的查看()
方法可以加载部分景色。
The View()
method can load Partial Views.
是之间查看
和 PartialView()
是查看差()( )
可以加载视图和局部视图和 PartialView()
只能装载部分的看法?
Is the difference between View()
and PartialView()
is that View()
can load views and partial views and PartialView()
can only load partial views?
推荐答案
这是给一个视图引擎,以决定是否要治疗从常规视图不同部分景色。
It's up to a view engine to decide if they want to treat partial views different from regular views.
例如,在WebFormViewEngine没有差别。
For example, in the WebFormViewEngine there is no difference.
在新的ASP.NET MVC 3 RazorViewEngine存在一定的差异。只有常规视图将有_viewstart.cshtml网页上,因为他们是为了的东西,如设置布局页。
In the new ASP.NET MVC 3 RazorViewEngine there are some differences. Only regular views will have the "_viewstart.cshtml" pages run because they are meant for things such as setting up layout pages.
这篇关于查看()主场迎战PartialView()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!