When sending jQuery post to MVC controller getting 404 error

Ankit Singh

Total Post:341

Points:2389

Posted by  Ankit Singh
 1268  View(s)
Ratings:
Rate this:

I'm sending from view using jQuery to MVC post action

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)
{
       ...
}

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.