If you check the code below, you will see the client side script src does not have ~ in front of the script path. the server side (runat=”server”) script path has a ~ in front of the script path. If the server side omit the ~ , it will still work at runtime, but at design time, it might trigger a javascript intellisense error, so that content of the server side javascript file will not be cached for intellisense.
This is a by design behavior in Visual Studio 2010 RC. So we just need to remember to follow the correct syntax.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="/Scripts/jquery-1.3.2.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="~/Scripts/jquery-1.3.2.js" /> </Scripts> </asp:ScriptManager> </div> </form> </body> </html>