DeveloperSection

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

When sending jQuery post to MVC controller getting 404 error

Anonymous User 1671 21-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 !

Leave Answer


Please enter your answer.


1 Answers

Liked By