WebResource and ScriptResource in ASP.NET

WebResource.axd and ScriptResource.axd are basically HTTP handlers in .NET Framework implementing IHttpHandler interface. Purpose of these HTTP handlers is to get the embedded resources inside an assembly.

We can easily find the following HttpHandler entry in root configuration file:

<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader"
validate="True"/>

WebResource.axd primarily focussing on embedded resources specifically web forms and validations scripts while ScriptResource.axd is more focussed on those scripts that have been registered with ScriptManager control.

ScriptResource has some additional features:

  • Keeping different types of the same resource i.e. for debug and release.
  • Compress scripts for transfering over HTTP.
  • It can also be used for other frameworks as jQuery.