question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edit Toolbar - Delete action returns 405 "Method Not Allowed" Error as Host Admin

See original GitHub issue

I’m submitting a bug report about the Edit/WebAPI experience using the Toolbar in a razor template.

Current behavior I have the following code in a template that is designed to allow a user to delete an item:

@Edit.Toolbar(toolbar: new object[] { 
	new { 
		command = new { 
			action = "delete", 
			entityId = photo.EntityId, 
			entityGuid = photo.EntityGuid, 
			entityTitle = photo.EntityTitle
		} 
	}
})

When the “Delete” action is run with the resulting URL from 2SXC using the DELETE method as a Host Admin:

http://somedomain.com/API/2sxc/app-content/any/f6a93bb0-32be-491c-b2bb-272fceb95455?zoneId=2&appId=13

IIS returns the following error:

HTTP/1.1 405 Method Not Allowed
Cache-Control: private
Allow: GET, HEAD, OPTIONS, TRACE
Content-Type: text/html
Set-Cookie: dnn_IsMobile=False; path=/; HttpOnly
X-Powered-By: ASP.NET
X-Powered-By-Plesk: PleskWin
Date: Tue, 27 Nov 2018 15:55:35 GMT
Content-Length: 1110

Expected behavior The WebAPI should accept the DELETE method and delete the item.

Minimal reproduction of the problem with instructions Create a new Content Type and add an item. Create a razor template that grabs the item and add the custom EDIT.TOOLBAR to the page with the delete action.

What is the motivation / use case for changing the behavior? We allow users to add/edit/delete photos (a separate Content Type) that are posted for an article. The add and edit actions work fine, but the delete method returns the error.

Please tell us about your environment: IIS 8.5 / Plesk shared hosting

2sxc version(s): 9.33

Browser: all

DNN: 9.2.2

Language: English

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
tpperlmancommented, Jul 29, 2020

I keep coming back to this thread, and at the risk of the SO solution going away I would like to document it here:

In case anyone having the same issue.

Here is another way you can try.

in web.config

<system.webServer>
    <modules>
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <remove name="WebDAV" /> 
    </handlers>
</system.webServer>
2reactions
10PoundGorilla-ChrisBehlingcommented, Feb 26, 2021

The solution noted above by @tpperlman did the trick in one of our instances where we were experiencing this issue today.

DNN: 9.8.0 2sxc: 11.11.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the HTTP 405 Method Not Allowed Error
Are you getting the "405 Method Not Allowed" HTTP error message? Learn what's causing it and how to fix it with this in-depth...
Read more >
How to Fix the HTTP 405 Method Not Allowed Error
The 405 method not allowed is an HTTP status code from the 4xx branch, indicating client-side error responses. In particular, a 405 response...
Read more >
Your Guide to Fixing the 405 Method Not Allowed Error
Learn why you are seeing 405 errors appearing on your website, and discover the steps to fixing the problem with this easy-to-follow guide....
Read more >
HTTP Verbs PUT and DELETE: 405 Method not allowed
I'm using ASP.NET Core 5 and there is no need to modify the web.config to remove WebDav or anything. I believe most people...
Read more >
Why your Website is giving an HTTP 405 Method Not ...
When a response has the status code 405, the client attempted to access a resource using an HTTP method that is not permitted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found