时间:2010-07-26 17:40:03

标签: asp.net-mvc-2

1 个答案:

答案 0 :(得分:1)

此特定网站可能有所帮助:http://dotnet.dzone.com/news/how-call-controllers-external-

它的剪辑张贴在此讨论

Route externalBlogRoute = new Route(
    "blog/{controller}/{action}/{id}",
    new MvcRouteHandler()
);

externalBlogRoute.DataTokens = new RouteValueDictionary(
    new {
         namespaces = new[] { "ExternalAssembly.Controllers" }
    });

routes.Add("BlogRoute", externalBlogRoute);


routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = "" },
    new[] { "ExternalAssembly.Controllers" }
);