Asp.net mvc ASP.NET MVC+;S#arp架构设计师+;Spark View发动机-Can';不要使用ActionLinkForAreas
我决定在我的新项目中使用ASP.NETMVC、S#arp架构和Spark View引擎 首先,我在S#arp的帮助下创建了一个新项目 我试图将S#arp架构的视图更新为.spark文件 除了剩下的一个例外,这一切都很好。在HTMLHelper类中找不到Application.spark中使用的ActionLinkForAreas方法:Asp.net mvc ASP.NET MVC+;S#arp架构设计师+;Spark View发动机-Can';不要使用ActionLinkForAreas,asp.net-mvc,enterprise,spark-view-engine,s#arp-architecture,Asp.net Mvc,Enterprise,Spark View Engine,S#arp Architecture,我决定在我的新项目中使用ASP.NETMVC、S#arp架构和Spark View引擎 首先,我在S#arp的帮助下创建了一个新项目 我试图将S#arp架构的视图更新为.spark文件 除了剩下的一个例外,这一切都很好。在HTMLHelper类中找不到Application.spark中使用的ActionLinkForAreas方法: error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Acti
error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'ActionLinkForAreas' and no extension method 'ActionLinkForAreas' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
调用Application.spark:
${Html.ActionLinkForAreas(c=>c.Index(),“Home”)}
奇怪的是,在我添加Spark View引擎之前,它就工作了
我非常感谢您的帮助只是一个猜测,但我认为您需要导入
SharpArch.Web.Areas
名称空间,以便在Spark文件中使用它
在Spark配置中,执行以下操作:
var settings = new SparkSettings();
settings.AddNamespace("SharpArch.Web.Areas");
engines.Add(new SparkViewFactory(settings));
您也可以在顶部的特定.spark文件中执行此操作:
<use namespace="SharpArch.Web.Areas" />