我怎样才能得到Html.RenderAction叫上发表的Get方法? [英] How can I get Html.RenderAction to call the Get method on a Post?

查看:122
本文介绍了我怎样才能得到Html.RenderAction叫上发表的Get方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

渲染上发表观点后,调用视图内会的RenderAction呼吁Post方法。有什么办法可以指定我要调用get方法,而不是帖子?

After rendering a view on a Post, a call to RenderAction inside the view will call for the Post method. Is there any way to specify I want to call the Get method instead of the Post?

推荐答案

这不是一个单独的请求发生,因此它会使用现有的请求上下文。您可能要区分它的名字的动作,并使用ChildActionOnly属性,因为只有标志着该行动通过为的RenderAction可用

It's not a separate request happening, so it's going to use the existing request context. You may want to differentiate the action by its name, and use the ChildActionOnly attribute to mark that action as only being available via RenderAction

这篇关于我怎样才能得到Html.RenderAction叫上发表的Get方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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