A brief analysis of the file difference between suffix ashx and Axd

Source: Internet
Author: User
Tags config
In fact, the extension of ashx and Axd is basically the same, are used to write Web handler, you can invoke the IHttpHandler class, it eliminates the normal. aspx page control resolution and the process of page processing.  

The only difference is that the Axd extension must be registered in So in the project's Add file, the wizard only adds the template for the ashx file, not the Axd file. Why is Microsoft so boring to do two suffixes, all use ashx not just do? Crisp It turns out that if your Web handler code isn't in a Web project, you can't use ashx, because if you don't register in web.config, the system doesn't know where to find the code in that DLL library.
such as:
<add verb= "*" path= "Opensearch.axd" type= "Company.Components.HttpHandler.OpenSearchHandler, (namespace. Class name) company.extensions (. dll file name) "validate= false"/>
only registered, The web only knows that Opensearch.axd was originally in Company.Extensions.dll, using Company.Components.HttpHandler.OpenSearchHandler class processing.
Of course you get a <add verb= "*" path= "Opensearch.ashx" type= .... That's not the norm. The principle in
  Webconfig is that IIS will first handle the. axd file and then give it to freetextboxcontrols.assemblyresourcehandler,  . Freetextbox this named class to handle rather than let the ASPNET handle it.  
  But your server provider may have removed the mapping of the. Axd to the Aspnet_isapi.dll for security reasons, so you're running the wrong server. The only thing you can do now is to contact your server provider and have them restore this mapping.  
  Extension:   .axd 
  Execute file: C:WINDOWSMICROSOFT.NETFRAMEWORKV1.1.4322ASPNET_ISAPI.DLL&NBsp
  Limited to:get,head,post,debug 
  script engine tick
There is a default mapping in the server's IIS: Mapping *.axd to Aspnet_isapi.dll.  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.