gpt4 book ai didi

c# - 注册ClientScriptInclude

转载 作者:太空宇宙 更新时间:2023-11-03 19:34:11 25 4
gpt4 key购买 nike

我在部分回发后使用 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 方法中

关于c# - 注册ClientScriptInclude,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2984662/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com