views:

29

answers:

2

I have a ASP.NET solution in Visual Studio 2008 and I added a file identical to http://plugins.jquery.com/files/jquery.cookie.js.txt named jquery.cookie.js in a subfolder of my project containing other javascript files and Visual Studio is treating it as a C# file, giving me errors like CS1012: Too many characters in character literal and Semicolon after method or accesssor block is not valid.

Why?

A: 

Open the .js file properties in Visual Studio and make sure that Build Action is Content or None, but not Compile.

Julien Lebosquain
The only two properties listed is File Name and Full Path (readonly). Maybe because it is setup as a website not a web project?
divitiae
A: 

Ok, figured it out. I accidentally had runat="server" on one of the <script> tags that included the file. I guess that caused it to try to compile

divitiae