パーシャルをロードするだけなのに、なぜコントローラー引数が必要なのですか? コントローラーメソッドにロジックが組み込まれていますか?
ただ試してみてください:
@{ Html.RenderAction("GlobalNavigation"); }
それ以外の場合は、プロジェクトで HTML ヘルパーを使用してメイン ナビゲーションを構築することをお勧めします。
例えば。
ヘルパーインPROJECT.Web.ExtensionMethods.HtmlExtensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
namespace OHTP.Web.ExtensionMethods
{
public static class HtmlExtensions
{
public static MvcHtmlString NavMenuLink(this HtmlHelper helper, string linkText, string actionName, string controlName, string activeClassName)
{
if (helper.ViewContext.RouteData.Values["action"].ToString() == actionName &&
helper.ViewContext.RouteData.Values["controller"].ToString() == controlName)
{
var menuLink = helper.ActionLink(linkText, actionName, new { Controller = controlName }, new {Class = activeClassName});
return menuLink;
}
return helper.ActionLink(linkText, actionName, controlName);
}
}
}
次に、パーシャルで呼び出します
<%= Html.NavMenuLink("Copy to display", "ControllerName", "Link", "class") %>