Question

I'm trying to combine a couple of javascript files using the SquishIt library. I'm following the steps that are provided here but I'm getting a compilation error stating " CS1026: ) expected" when I try to load the page. The application is an ASP.NET MVC2 app.

The code for the SquishIt functionality is:

<%@ Import Namespace="SquishIt.Framework" %>

and in the body of my html:

<%= Bundle.JavaScript()
    .Add("~/Scripts/jquery-1.4.2.js")
    .Add("~/Scripts/jquery-ui-1.8.2.js")
    .ForceRelease()
    .Render("~/Scripts/combined_#.js");
%>    

Any Ideas?

Was it helpful?

Solution

You can't use <%= with a ; so you need to do:

<%= Bundle.JavaScript()... .Render("..") %>

Or

<% Bundle.JavaScript() .. .Render(".."); %>

So it depends on what Render does, if it returns a string, you have to use the <%= %> syntax, but if it does the rendering, then you have to use a semi-colon.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top