开发者

Check if a javascript file is already loaded on a page

How to check in C# if a javascript file is already loaded on to the page? Let's say I have a user control in a different namespace that I load on to a page. I would like to see if a script file doesn't exist before I register it with the scriptma开发者_StackOverflow社区nager.


You're looking for ScriptManager.GetRegisteredClientScriptBlocks(). From that collection of RegisteredScript objects you can use the Type and Key properties to uniquely identify them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜