This documentation is archived and is not being maintained.

ScriptReference::Name Property

Gets or sets the name of the embedded resource that contains the client script file.

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

public:
property String^ Name {
	String^ get ();
	void set (String^ value);
}

Property Value

Type: System::String
The name of the client script file that is embedded as a resource in an assembly.

You set the Name property to reference a client script file that is embedded as a resource in an assembly.

If you define values for both the Path and Name properties in the same script reference, the Path property takes precedence.

The following example shows how to reference a custom control and a JavaScript file that is embedded in the control assembly. The assembly is assumed to be in the Bin folder of the Web site. The custom control animates UpdatePanel controls. The JavaScript file is compiled as an embedded resource that is named SampleControl.UpdatePanelAnimation.js. You register the embedded JavaScript file by using the Assembly and Name properties.

To use this example, compile the JavaScript file that is shown in the example as an embedded resource with the custom control. Put the resulting assembly into the Bin folder of the Web site. For an example of how to embed a JavaScript file in an assembly, see Walkthrough: Embedding a JavaScript File as a Resource in an Assembly.

The following example shows a page that uses the custom control.

No code example is currently available or this language may not be supported.

The following example shows the custom control class definition.

No code example is currently available or this language may not be supported.

The following example shows the supporting JavaScript file.

No code example is currently available or this language may not be supported.

The following example shows code that you must add to the AssemblyInfo file of the project that contains the custom control and the JavaScript file.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: