Significance of WebResource.axd file in ASP.NET


Here we are going to see what is a WebResource.axd file. what is its importance in asp.net. what are the contents stored in the Resource assembly file. An embedded resource is a resource file which can contain files of type images or javascript files or css files which are embedded in the compiled assembly. this allows external resources to be embedded into the assembly. therefore entire application can exist in a single file.

embedded resource
An embedded resource is a resource file which can contain files of type images or javascript files or css files which are embedded in the compiled assembly. this allows external resources to be embedded into the assembly. therefore entire application can exist in a single file.
For Example Consider AJAX controls. These controls require that certain JavaScript functions be present in order for them to use client-side validation. When using the AJAX controls you don't need to add any JavaScript files to your website; instead, the JavaScript used by these controls is embedded in one of the built-in AJAX assemblies called as AjaxToolKit.dll.

The question here is, if the external resources are embedded in the assembly, how can we get it out of the assembly and then onto a web page? It is done using WebResource.axd

WebResource.axd
WebResource.axd is an HTTP Handler that is part of the .Net Framework that gets an embedded resource out of a DLL and returns its contents. The DLL and the embedded resource to be taken of the DLL are specified through the querystring.
For example, a request to www.mysite.com/WebResource.axd?d=Eqref…&t=34556… might return a particular code block of JavaScript embedded in a particular assembly. The d querystring parameter contains encrypted information that specifies the assembly and resource to return; the t querystring parameter is a timestamp and is used to only allow requests to that resource using that URL for a certain window of time.


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: