---
title: "When sending jQuery post to MVC controller getting 404 error"  
description: "When sending jQuery post to MVC controller getting 404 error"  
author: "Anonymous User"  
published: 2015-05-21  
updated: 2015-05-21  
canonical: https://www.mindstick.com/forum/23247/when-sending-jquery-post-to-mvc-controller-getting-404-error  
category: "jquery"  
tags: ["mvc", "controller", "error"]  
reading_time: 1 minute  

---

# When sending jQuery post to MVC controller getting 404 error

I'm sending from [view](https://yourviews.mindstick.com/view/84701/layoffs-in-google-india-2023-view) using jQuery to [MVC](https://www.mindstick.com/forum/155803/define-cache-profile-in-mvc) [post](https://www.mindstick.com/articles/12829/aspects-that-make-australia-post-shipping-extension-a-useful-tool) [action](https://www.mindstick.com/forum/155752/what-is-action-result-with-its-types)

```
function DoSomething(passedId) {                    $.ajax({                        method: "POST",                        dataType: 'text',                        url: '/MyController/SomeAction/',                        data: { id: passedId }                    }).done(function (data) {                        //                                            });                }
```

And inside MyController

```
[HttpPost]public ActionResult SomeAction(int id){       ...}
```

## Replies

### Reply by Anonymous User

You didn't said which version of jquery you are using. Please check jquery version and in case that this version is < 1.9.0 you should instead of

Method: ”post”

Use

Type: ”post”

this is an alias for method, and according to jquery official documentation you should use type if you're using versions of jQuery prior to 1.9.0.

```
function DoSomething(passedId) {                        $.ajax({                        type: "POST",                        dataType: 'text',                                               url: '/MyController/SomeAction/',                        data: { id: passedId}                    }).done(function (data) {                                                                ...                    });                }
```

Tested above code and it works (each request enter inside mvc controller http post SomeAction action).


---

Original Source: https://www.mindstick.com/forum/23247/when-sending-jquery-post-to-mvc-controller-getting-404-error

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
