0

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?

1 Answer 1

4

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.

2
  • 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
    Jul 23, 2010 at 18:03
  • I know I do it all the time :-) Jul 23, 2010 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.