ScriptReference::Name Property
Gets or sets the name of the embedded resource that contains the client script file.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Property Value
Type: System::String^The name of the client script file that is embedded as a resource in an assembly.
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.
The following example shows the custom control class definition.
The following example shows the supporting JavaScript file.
BorderAnimation = function(color) { this._color = color; } BorderAnimation.prototype = { animate: function(panelElement) { var s = panelElement.style; s.borderWidth = '2px'; s.borderColor = this._color; s.borderStyle = 'solid'; window.setTimeout( function() {{ s.borderWidth = 0; }}, 500); } }
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.
Available since 3.5