Getting Error "CS1026: ) expected" when trying to combing .js files using SquishIt
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"开发者_如何学C %>
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?
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.
精彩评论