We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve the "404 error" that occurs when delete API is called in WebAPI application?

Platform: ASP.NET MVC |
Control: Grid


While triggering the deleteAPI in the WebApi sample, the following error is obtained and thus the deleteApi is not called.

Server Error in '/' Application.

The resource cannot be found.


HTTP 404. The resource you are looking for, or one of its dependencies, could have been removed, had its name changed, or is temporarily unavailable. Review the following URL and make sure that it is spelled correctly.

Requested URL: /api/Orders/10248


When the POST and PUT actions are triggered, no additional parameters are appended to the Route link, that is api/Orders, and so these events are triggered. Refer to the following screenshot.



Figure 1: POST and PUT actions triggered

When the DELETE action is triggered, the primary key value is also appended to the Route link, that is, api/Orders/10248. Refer to the following screenshot.



Figure 2: DELETE action triggered


Since the Route in the WebApiConfig file does not include the id parameter, the 404 error is thrown. Refer to the following screenshot.

Incorrect Example

So changing the Route link in the WebApiConfig resolves this error.

Correct Example


After changing the route in the WebApiConfig.cs file, the deleteApi is called as shown in the following screenshot.


Figure 3: Result

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile