开发者

Check if a javascript file is already loaded on a page

开发者 https://www.devze.com 2023-01-03 17:16 出处:网络
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

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

精彩评论

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

关注公众号