ClientScriptManager.IsClientScriptIncludeRegistered Method (String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Determines whether the client script include is registered with the Page object using the specified key.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public bool IsClientScriptIncludeRegistered(
	string key


Type: System.String

The key of the client script include to search for.

Return Value

Type: System.Boolean

true if the client script include is registered; otherwise, false.

Call this method before calling the RegisterClientScriptInclude method to avoid registering duplicate scripts. This is particularly important if the script requires a large amount of server resources to create.

A client script include is uniquely identified by its key and its type. Scripts with the same key and type are considered duplicates.

This overload of the IsStartupScriptRegistered method calls the overload that takes both a key and a type parameter with the type set as a Page object.

.NET Framework
Available since 2.0
Return to top