【问题标题】:ASP.NET MVC3 Combres error: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink'ASP.NET MVC3 Combres 错误:“System.Web.Mvc.UrlHelper”不包含“CombresLink”的定义
【发布时间】:2012-01-16 03:48:07
【问题描述】:

我正在尝试在 Asp.Net MVC 3 站点上按照他们的文档中的 this tutorial 设置 Combres。

我按照所有步骤操作,但运行时出现以下错误:

编译错误

描述:编译资源时出错 需要为该请求提供服务。请查看以下具体内容 错误详情并适当修改您的源代码。

Compiler Error Message: CS1061: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink' and no extension method 'CombresLink' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 5:      
Line 6:      @Sprite.ImportStylesheet("~/App_Sprites/")
--->    Line 7:      @Url.CombresLink("siteJs")
Line 8:      <script src="@Url.Content("~/Scripts/excanvas.js")" type="text/javascript"></script>
Line 9:      @RenderSection("HeadScripts", required: false)

siteJs 是我在 conbres.xml 文件中的 javascript resourceSet 引用。 在我的网络配置中,我有:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
        <add type="Microsoft.Web.Samples.ImageOptimizationModule" name="Microsoft.Web.Samples.ImageOptimizationModule" />
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

(这使用的 System.Web.Routing.UrlRoutingModule 版本与教程中提到的版本不同。如果我尝试引用教程中的版本,我不能,因为我没有较旧的 DLL。)

如何正确设置?

【问题讨论】:

    标签: asp.net-mvc-3 combres


    【解决方案1】:

    在视图中你包含了

    @using Combres.Mvc
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-25
    • 2011-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多