What is WebResource.axd?

  • WebResource.axd is an HTTP Handler, part of the .NET Framework 
  • The main task is getting an embedded resource out of a DLL and returning its content
How to embedding an External Resource
  1. Right click the file in the project
  2. set the file's Build Action to "Embedded Resource"
Accessing the Embedded Assembly through a URL
  1. Page.ClientScript.GetWebResourceUrl(this.GetType(), "filename.js")
  2. Using the above code you can register it in the client script (Page.ClientScript.RegisterClientScriptInclude)
  3. <script src="/TestWebsite/WebResource.axd?d=xlz&t=987" type="text/javascript">