ScriptResourceAttribute Class
Defines a resource in an assembly to be used from a client script file. This class cannot be inherited.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
The ScriptResourceAttribute class is valid only when you use it in assembly declarations. You use it to enable a specified embedded script resource in an assembly. You can define the name of the embedded script library, the name of the resource file for the script library, and the name that is used in a script file for retrieving the resource values. The ScriptManager class uses the properties in ScriptResourceAttribute to determine the correct resource name for a script library. The TypeName property is used with a resource key to specify a resource.
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.
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.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.