Tag Archives: ashx Http Delete method not allowed

[How to Solve] ashx Http Delete method not allowed

Reference answer 1 (invalid)

<system.webServer>
	<security>
		<requestFiltering>
			<verbs allowUnlisted="false">
				<add verb="GET" allowed="true" />
				<add verb="POST" allowed="true" />
				<add verb="DELETE" allowed="true" />
				<add verb="PUT" allowed="true" />
				<add verb="OPTIONS" allowed="true" />
				<add verb="TRACE" allowed="true" />
			</verbs>
		</requestFiltering>
	</security>
</system.webServer>

Reference answer 2 (invalid)

<system.webServer>
	<handlers>
		<remove name="WebDAV" />
		<remove name="OPTIONSVerbHandler" />
		<remove name="TRACEVerbHandler" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
	</handlers>
	<modules>
		<remove name="WebDAVModule" />
	</modules>
</system.webServer>

Using. Net 4.0 asp.net technology, no “webdavmodule” module was found

Correct answer

It is obvious that the error of ashx message is called to modify the handler of mapping “. Ashx” file, so the following items are found

Each of them should be revised

Or modify the web.config system.webserver configuration section:

<system.webServer>
    <handlers>
		<remove name="SimpleHandlerFactory-ISAPI-2.0-64" />
		<remove name="SimpleHandlerFactory-ISAPI-2.0" />
		<remove name="SimpleHandlerFactory-Integrated" />
		<remove name="SimpleHandlerFactory-ISAPI-4.0_32bit" />
		<remove name="SimpleHandlerFactory-Integrated-4.0" />
		<remove name="SimpleHandlerFactory-ISAPI-4.0_64bit" />
		<add name="SimpleHandlerFactory-ISAPI-4.0_64bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
		<add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
		<add name="SimpleHandlerFactory-ISAPI-4.0_32bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
		<add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv2.0" />
		<add name="SimpleHandlerFactory-ISAPI-2.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
		<add name="SimpleHandlerFactory-ISAPI-2.0-64" path="*.ashx" verb="GET,HEAD,POST,DEBUG,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
	</handlers>
</system.webServer>

Solution (- V -)