views:

74

answers:

1

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?

+2  A: 

Hey,

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.

Brian
Thanks, that was the problem. So used to ending every statement with a semi-colon that I didn't even notice that I'd done it.
Hamman359
I know I do it all the time :-)
Brian