forum

Home / DeveloperSection / Forums / When sending jQuery post to MVC controller getting 404 error

When sending jQuery post to MVC controller getting 404 error

Anonymous User190421-May-2015

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

Updated on 21-May-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By