Edit Toolbar - Delete action returns 405 "Method Not Allowed" Error as Host Admin
See original GitHub issueI’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:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
I keep coming back to this thread, and at the risk of the SO solution going away I would like to document it here:
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