1.下载jquery_1.7并解压出jquery-1.7.2.js和jquery-1.7.2.min.js文件
2.在网页项目的根目录创建文件夹scripts并将上述文件复制进去
3.在项目中添加全局应用程序类Global.asax文件,在Application_Start事件中添加如下代码:
[csharp]
view plain
copy
ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition { Path = "~/scripts/jquery-1.7.2.min.js", DebugPath = "~/scripts/jquery-1.7.2.js", CdnPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.2.min.js", CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.7.2.js" });
注:需要在Global.asax文件中添加下述语句(包含ScriptManager类)
[csharp]
view plain
copy
using System.Web.UI;