How can I get Html.RenderAction to call the Get method on a Post?

三世轮回 提交于 2019-12-01 01:09:25

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3757072/how-can-i-get-html-renderaction-to-call-the-get-method-on-a-post

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!