开发者

RenderAction in an HtmlHelperExtension Method?

开发者 https://www.devze.com 2022-12-27 22:42 出处:网络
I am trying to call the RenderAction Extension Method within my own Html Helper: System.Web.Mvc.Html.ChildActionExtensions.RenderAction(helper, \"account\", \"login\");

I am trying to call the RenderAction Extension Method within my own Html Helper:

System.Web.Mvc.Html.ChildActionExtensions.RenderAction(helper, "account", "login");

this is so that along with some additional logic, I would like all html helpers to use a common method name structure when calling it on the view:

<%= Html.CompanyNam开发者_如何学Goe().RenderAccount() %>

but the problem I am having is that, asp.net will complain about not finding the actual route it needs to process. It does not take in the parameters of "controller" to be used as the action and "login" to be used as the action. It seems to only reference the current route.

Any ideas how I can package up the RenderAction?


Sorry all, I made a mistake:

It should have been:

System.Web.Mvc.Html.ChildActionExtensions.RenderAction(helper, "register", "account");

This is now resolved.

0

精彩评论

暂无评论...
验证码 换一张
取 消