を複製、私は私の主にHomeController(エリア上のナビゲーションアクションを持っています=私は私の管理ポータブルエリアに別のにHomeControllerを追加するまで、「」)私は私のSite.MasterからMVC先物強く型付けされたRenderActionと私はMVC先物ライブラリ</p> <p>から強く型付けされた自然の中でHtml.RenderActionを使用しようとしているコントローラ名と
<% Html.RenderAction<HomeController>(x=>x.Navigation()); %>
を呼び出すようにしようとしていることをこれがとてもうまくいきました。それから私は、次のエラーのため開始:
Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.
The request for 'Home' has found the following matching controllers: Areas.Admin.Controllers.HomeController Web.Controllers.HomeController
私は、次の非mvccontrib強く型付けされたRenderActionメソッドを使用して問題を解決することができました。 mvccontribメソッドが領域を受け入れるようにする方法、または指定されているルートまたはコントローラの名前空間に基づいて領域を生成する方法を知る方法があります。
<% Html.RenderAction("Navigation", "Home", new { area = "" }); %>
下図のように私はすでにデフォルトのエリアで複数のコントローラをサポートするために、私のglobal.asax.csファイルに追加した、と私はまた、これは私のコントローラの正しい名前空間であることを確認しました。
_routeCollection.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "Web.Controllers" });
素敵な仕事!!!!!!! –