A brief analysis of the differences between files suffixed ashx and axd

  • 2020-06-19 10:07:03
  • OfStack

The only difference is that the axd extension must be in web.config < httpHandlers > , and ashx is simply added to the project as aspx.
So in the project's add file, the wizard only has templates for adding ashx files, not axd files. So why is Microsoft so bored with two suffixes, using ashx? Crisp and neat. It turns out that if your web handler code is not in the Web project, you cannot use ashx, because if you are not registered in web.config, the system does not know that you need to find the corresponding code in the dll library.
Such as:
< add verb = "*" path = "OpenSearch. axd type" = "Company. Components. HttpHandler. OpenSearchHandler, (namespace. The name of the class) Company. Extensions (. dll filename)" validate = "false" / >
Only registered, web know OpenSearch. axd turned out to be in Company. Extensions. dll, use Company. Components. HttpHandler. OpenSearchHandler class to handle.
Of course you do < add verb = "*" path = "OpenSearch. ashx" type =... That's not possible, just customary norms.
So the idea in webconfig is that first iis will take the.axd file handle, and then give it to the named class FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox instead of aspnet.
But your server provider may have taken the.axd to ES68en_isapi.dll mapping out for security reasons, so you're running on the wrong server. The only thing you can do right now is contact your server provider and ask them to restore the mapping.
Extension:.axd
C:\WINDOWS\Microsoft \Framework\ es79EN1.1.4322 \ es80EN_isapi.dll
Limited to: GET, HEAD POST, DEBUG
Check script engine
The default mapping in IIS on the server is to map *.axd to ES92en_isapi.dll.

Related articles: