title: http error 405 method not allowed error with web.API
body: <p>I know I am not the first one to come across this, but I have tried all the suggested fixes and still can not get it to work.  I want to use the DELETE and PUT verbs with my web.API services and DNN 7.</p>
  
  <p>Here is my code for the service:</p>
  
  <pre><code>    routeManager.MapHttpRoute(moduleName, "deleteproduct", "{controller}/{action}/{ID}", New String() {"Krisis.Modules.KrisisStore.Services.Controllers"})
  
      ' DELETE: /deleteproduct/
      &lt;HttpDelete&gt; _
      &lt;ActionName("deleteproduct")&gt; _
      &lt;ValidateAntiForgeryToken&gt; _
      Public Function DeleteProduct_ById_Full(ID As Integer) As HttpResponseMessage
          Try
              ...
          End Try
  
      End Function
  </code></pre>
  
  <p>Here is my ajax call (using knockout.js for my viewmodel):</p>
  
  <pre><code>// ****** CONFIRM DELETE FUNCTION ************************************************** 
  this.confirmDelete = function () {
  
      //delete product web.Api url
      var sURL = "http://" + window.location.hostname + "/DesktopModules/KrisisStore/api/ProductService/deleteproduct/" + self.selectedProduct().ProductId;
  
      jQuery.ajax({
          type: "DELETE",
          url: sURL,
          success: function (response) {
  
              alert('Product Removed');
  
          },
          error: function (xhr, ajaxOptions, thrownError) {
              alert("status: " + xhr.status + "\n" + thrownError);
              //alert('There was an error');
          }
      });
  
      $('#DeleteModal').foundation('reveal', 'close');
  };
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>HTTP Error 405.0 - Method Not Allowed
  
  The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
  </code></pre>
  
  <h2>WHAT I TRIED:</h2>
  
  <p>I found <a href="https://stackoverflow.com/questions/10906411/asp-net-web-api-put-delete-verbs-not-allowed-iis-8">This SO question</a> and followed the accepted answer:
  I added the verbs to both the DNN web.config file and the IIS aplicationhost.config file as follows:</p>
  
  <pre><code>&lt;add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
  &lt;add name="ExtensionlessUrl-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /&gt;
  &lt;add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /&gt;
  &lt;add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" /&gt;
  </code></pre>
  
  <p>One of the solutions is to make sure webDAV is disabled, but I noticed that the dnn web.config file already comments out these webDAV lines in the web.config file.  SO I also commented out the lines in the applicationhost.config file.  </p>
  
  <p>I am going to remove webDAV from IIS to see if that helps and update my question.</p>
  
  <h2>QUESTION</h2>
  
  <p>I am still getting this error.  Can someone help me figure out how to add custom verbs to the HTTP requests for DNN 7 sites on IIS 8 express.</p>