我在部分回发后使用 ScriptManager.RegisterClientScriptInclude 来包含 js 文件,它工作正常这里 :**
ScriptManager.RegisterClientScriptInclude(this, typeof(test4), "1", Page.ResolveClientUrl("~/slideshow/js/slideshow.js"));
**但我想加载多个 js 文件,所以我这样做了 **
ScriptManager.RegisterClientScriptInclude(this,typeof(test4),"one", Page.ResolveClientUrl("~/slideshow/js/slideshow.js")); ScriptManager.RegisterClientScriptInclude(this, typeof(test4), "two", Page.ResolveClientUrl("~/slideshow/js/slideImg.js"));
**使用两个不同的字符串键,第一个有效,但第二个无效....请帮忙
下面的代码适合我:
string jquery = "js/jquery-1.4.min.js";
Page.ClientScript.RegisterClientScriptInclude(jquery, jquery);
string myScript = "js/myScript.js";
Page.ClientScript.RegisterClientScriptInclude(myScript, myScript);
我把它放在我的 OnPreRender 方法中
我是一名优秀的程序员,十分优秀!