开发者

Getting Error "CS1026: ) expected" when trying to combing .js files using SquishIt

开发者 https://www.devze.com 2023-01-08 19:42 出处:网络
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\" whe

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消