ASP.NET MVC3 Combres error: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink'

2.3k views Asked by At

I am trying to set up Combres on an Asp.Net MVC 3 site following this tutorial from their documentation.

I followed all of the steps, but when I run I get the following error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

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 is my javascript resourceSet reference in the conbres.xml file. In my web config I have:

<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>

(This is using a different version of System.Web.Routing.UrlRoutingModule than the one referred to in the tutorial. If I try to reference the version from the tutorial I cannot because I don't have the older DLL.)

How do I set this up properly?

1

There are 1 answers

2
Manas On BEST ANSWER

in the View have you included

@using Combres.Mvc