views:

160

answers:

2

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 scriptmanager.

A: 

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

seraphym