Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

ScriptResourceHandler Class

Provides an HTTP handler for processing requests for script files that are embedded as resources in an assembly. This class cannot be inherited.

Syntax

CSharp

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ScriptResourceHandler : IHttpHandler

VisualBasic

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class ScriptResourceHandler _
	Implements IHttpHandler

ManagedCPlusPlus

[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class ScriptResourceHandler : IHttpHandler

JSharp

/** @attribute AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) */
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */
public class ScriptResourceHandler implements IHttpHandler

Members

IconMemberDescription
ScriptResourceHandlerNew()Initializes a new instance of the ScriptResourceHandler class.
Equals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize()Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetHashCode()Serves as a hash function for a particular type. (Inherited from Object.)
GetType()Gets the Type of the current instance. (Inherited from Object.)
IsReusableWhen overridden in a derived class, gets a value that indicates whether another request can use the instance of the class.
MemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
ProcessRequest(HttpContext)When overridden in a derived class, processes HTTP Web requests for a script file that is embedded as a resource in an assembly.
ToString()Returns a String that represents the current Object. (Inherited from Object.)

Remarks

The ScriptResourceHandler class processes all requests for embedded script files that are referenced through the ScriptManager class. The ScriptResourceHandler object retrieves the embedded script library and any localized resources for the script library. If the NotifyScriptLoaded property is set to true, the ScriptResourceHandler object adds a call at the end of the script file to the notifyScriptLoaded method of the Sys.Application object.

By default, the ScriptResourceHandler class compresses and caches embedded script files for Internet Explorer 7. You can turn compression and caching off through the EnableCompression and EnableCaching properties of the ScriptingScriptResourceHandlerSection class. You set these properties in the Web.config file.

note

You can turn compression on for earlier versions of Internet Explorer by creating an alias for Internet Explorer 7 in the clientTarget Element (ASP.NET Settings Schema) section of the Web.config file, and then programmatically setting the value of the ClientTarget property to that alias. However, we do not recommend this approach because it will cause a decrease in performance and a high risk of errors.

The default Web.config file that is installed with Microsoft ASP.NET AJAX adds the ScriptResourceHandler as a handler. You can manually add the handler to your application by including the following element in the Web.config file.

<httpHandlers>
  <add verb="GET,HEAD" path="ScriptResource.axd" 
    type="System.Web.Handlers.ScriptResourceHandler, 
    System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
    PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>

Permissions

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: InheritanceDemand. Permission value: Minimal.

Inheritance Hierarchy

Object

  • ScriptResourceHandler

Assembly: System.Web.Extensions (Module: System.Web.Extensions)