views:

110

answers:

1

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

No overload for method 'RenderAction' 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

+1  A: 

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?

David Ebbo
I downloaded latest version of MVC 2 and got ChildActionExtensions available. Guess I had some kind of RC/Beta of MVC 2.Thank you
knepe