What is the difference between files suffixed with ashx and axd?

Source: Internet
Author: User

In fact, the extension ashx is basically the same as axd. It is used to write web handler and can be used to call the IHttpHandler class. the control parsing and page processing process of the aspx page.
The only difference is that the axd extension must be registered in Therefore, in the Add file of the project, the wizard only adds the template of the ashx file, but does not add the template of the axd file. Why is it that Microsoft is so bored with two suffixes that it is not enough to use all of ashx? Neat and neat. It turns out that if your web handler code is not in the Web project, you cannot use ashx because it is not in the web project. if it is registered in config, the system does not know which dll library to find the corresponding code.
For example:
<Add verb = "*" path = "OpenSearch. axd "type =" Company. components. httpHandler. openSearchHandler, (namespace. class Name) Company. extensions (. dll file name) "validate =" false "/>
Only after registration, the web will know that OpenSearch. axd was originally in Company. Extensions. dll and processed using the Company. Components. HttpHandler. OpenSearchHandler class.
Of course, you just need to set up <add verb = "*" path = "OpenSearch. ashx" type =... that's not a problem, so it's just a habit.
In webconfig, the write principle is that iis will first handle the. axd file, and then hand it to FreeTextBoxControls. AssemblyResourceHandler, the class named FreeTextBox for processing instead of letting aspnet process it.

However, your server provider may remove the asping from. axd to aspnet_isapi.dll for security reasons, so you will be wrong when running on the server. The only thing you can do now is to contact your server provider to restore the ing.
 
Extension:. axd
Execution file: C: \ WINDOWS \ Microsoft. NET \ Framework \ v1.1.4322 \ aspnet_isapi.dll

Restrictions: GET, HEAD, POST, DEBUG
Script Engine check
There is a default ing in IIS on the server: ing *. axd to aspnet_isapi.dll.

 

From Crazy Coding life of Heda Li Xin

Related Article

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.