ScriptResourceAttribute.ScriptResourceName Property
.NET Framework (current version)
Note: This API is now obsolete.
Namespace:
System.Web.UI
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Return to top
Gets the name of the resource file for the script library.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
[ObsoleteAttribute("This property is obsolete. Use StringResourceName instead.")] public string ScriptResourceName { get; }
The following example shows a ScriptResourceAttribute attribute for a script file named CheckAnswer.js that uses resources from the VerificationResources resource files. The name Answer is used to reference these resources. In this example, the ScriptResourceName property returns "LocalizingResources.VerificationResources". The file name extension is not included when you define the ScriptResourceName.
[assembly: System.Web.UI.WebResource("LocalizingScriptResources.CheckAnswer.js", "application/x-javascript")] [assembly: System.Web.UI.ScriptResource("LocalizingScriptResources.CheckAnswer.js", "LocalizingScriptResources.VerificationResources", "Answer")]
The following example shows how to use the resources in client script. The resource keys (Correct and Incorrect) are prefixed with Answer to identify the script resource definition that contains the values.
.NET Framework
Available since 3.5
Available since 3.5
Show: