@ Html.Action在Asp.Net 5 MVC6 [英] @Html.Action in Asp.Net 5 MVC6

查看:295
本文介绍了@ Html.Action在Asp.Net 5 MVC6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里 @ Html.Action 在MVC6?
我可以看到 @ Html.ActionLink 而不是像以前那样直接调用一个动作。

Where is @Html.Action in MVC6? I can see @Html.ActionLink but not a direct call to an Action as before.

,它才被ViewComponents更换?

Was it replaced by ViewComponents?

推荐答案

是的,ViewComponents会是这样做的新途径,但它们的的完全一样,什么 @ Html.Action 在做之前,虽然...例如,MVC5和以前援引儿童行动也将执行任何过滤器(例如,如果控制器装饰了他们的过滤器)给他们的外观作为常规动作...但这不是与ViewComponents真实和它们在实际请求的上下文中执行...

Yes, ViewComponents would be the new way of doing this, but they are not exactly the same as what @Html.Action was doing before though...for example, in MVC5 and prior, invoking 'child actions' would also execute any filters (for example, if the controller had filters decorated on them) giving them the appearance as regular actions...but this is not true with ViewComponents and they are executed in the context of actual request...

更多信息:
<一href=\"http://www.asp.net/vnext/overview/aspnet-vnext/vc#intro\">http://www.asp.net/vnext/overview/aspnet-vnext/vc#intro

这篇关于@ Html.Action在Asp.Net 5 MVC6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆