开发者

Problem setting up T4MVC and MVC 2

I'm setting up T4MVC for MVC 2 on my website. I get 2 build errors:

No overload for method 'Rende开发者_JS百科rAction' takes 3 arguments in T4MVC.cs

and

No overload for method 'Action' takes 3 arguments in T4MVC.cs

These are the ones in the T4MVC.cs file:

public static void RenderAction(this HtmlHelper htmlHelper, ActionResult result) {
            var callInfo = result.GetT4MVCResult();
            htmlHelper.RenderAction(callInfo.Action, callInfo.Controller, callInfo.RouteValueDictionary);
        }

    public static MvcHtmlString Action(this HtmlHelper htmlHelper, ActionResult result) {
        var callInfo = result.GetT4MVCResult();
        return htmlHelper.Action(callInfo.Action, callInfo.Controller, callInfo.RouteValueDictionary);
    }

Thank you


That's strange, as those overloads exist on System.Web.Mvc.Html.ChildActionExtensions, which is a part of MVC:

public static class ChildActionExtensions {
    public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues);
    public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues);
}

And at the top of T4MVC.cs, there should be a 'using System.Web.Mvc.Html', which makes those extension methods available.

Are you able to call those same overloads in your own code?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜