System.Web.UI.ClientScriptManager.GetWebResourceUrl Method

Gets a URL reference to a resource in an assembly.

Syntax

public string GetWebResourceUrl (Type type, string resourceName)

Parameters

type
The type of the resource.
resourceName
The fully qualified name of the resource in the assembly.

Returns

The URL reference to the resource.

Remarks

The ClientScriptManager.GetWebResourceUrl(Type, string) method returns a URL reference to a resource embedded in an assembly. The returned reference is not URL encoded. Resources can be script files, images, or any static file. You specify the type based on the object that will be accessing the resource.

A Web resource registered with the page is uniquely identified by its type and name. Only one resource with a given type and name pair can be registered with the page. Attempting to register a resource that is already registered does not create a duplicate of the registered resource.

The ClientScriptManager.GetWebResourceUrl(Type, string) method is used in conjunction with the ClientScriptManager.RegisterClientScriptResource(Type, string) method for accessing resources embedded in assemblies. For more information on using resources in applications, see ASP.NET Web Page Resources Overview.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0