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 treatin开发者_StackOverflow社区g 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?
Open the .js file properties in Visual Studio and make sure that Build Action is Content or None, but not Compile.
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
精彩评论