Q: ASP.NET MVC POST Route does not point to the correct Method I´ve got a problem with my current mvc project. 
I´m using an ajax call to send new comments to the server but the method does not even get called. 
My js code: 
$("#answer_button").click(function () {
                showLoadingTab();
                var actionUrl = '@Url.Action("AnswerThread", "Threads")';
                var threadId = $("#threadId").val();
                var msg = $("#answer_msg").val();

                alert(actionUrl);
                alert(msg);
                alert(threadId);
                $.ajax({
                    url: actionUrl,
                    type: "POST",
                    data: "Message=" + msg + "&threadId=" + threadId,
                    success: function (msg) {
                        hideLoadingTab();
                        location.reload();
                    },
                    error: function () {
                        alert("Ein Fehler ist aufgetreten.");
                        hideLoadingTab();
                    }
                });
            });

as you see I´ve alerted the url, msg and threadId and they are all correct. url: "/Threads/AnswerThread", msg: "test", threadId: 1. 
I´ve already tried to put a breakpoint inside the AnswerThread method but it does not get called. The "AnswerThread" method is inside the "ThreadsController" and looks like this: 
[HttpPost]
    public ActionResult AnswerThread(string Message, int threadId)
    {
        var userId = User.Identity.GetUserId();

        using (var db = new UnitOfWork(new BlogContext()))
        {
            db.Posts.Add(new Post()
            {
                Message = Message,
                PublishTime = DateTime.Now,
                ThreadId = threadId,
                UserId = userId
            });

            db.Complete();
        }

        return PartialView("/Views/Partial/Clear.cshtml");
    }

That´s exactly the same way I did it in the backend controllers but there it just works fine.
I hope somebody can help me..

UPDATE:
Made some changes just to try if any other way works. 
Change1 js: 
var data = {
                    threadId: threadId,
                    Message: msg
                };


                $.ajax({
                    url: actionUrl,
                    type: "POST",
                    content: "application/json; charset=utf-8",
                    dataType: "json",
                    data: data,
                    success: function (msg) {
                        if (msg.success == true) {
                            hideLoadingTab();
                            location.reload();
                        }
                        else
                        {
                            alert("Ein Fehler ist aufgetreten: " + msg.error);
                        }
                    },
                    error: function () {
                        alert("Ein Fehler ist aufgetreten.");
                        hideLoadingTab();
                    }
                });

Change 2 c#: 
[HttpPost]
    public JsonResult AnswerThread([System.Web.Http.FromBody]PostDataModel data)
    {
        var userId = User.Identity.GetUserId();
        string error = "";
        bool success = false;

        try
        {
            using (var db = new UnitOfWork(new BlogContext()))
            {
                db.Posts.Add(new Post()
                {
                    Message = data.Message,
                    PublishTime = DateTime.Now,
                    ThreadId = data.threadId,
                    UserId = userId
                });

                success = true;
                db.Complete();
            }
        }
        catch(Exception ex)
        {
            error = ex.Message;
        }

        return Json(String.Format("'Success':'{0}', 'Error':'{1}'", success, error));

I tried this now with and without the "[FromBody]" statement. 
Oh yes and I´ve added the DataModel like this: 
public class PostDataModel
{
    public int threadId { get; set; }
    public string Message { get; set; }
}

and I also tried to manually configure the pointed route.
routes.MapRoute(
            name: "AnswerThread",
            url: "threads/answer",
            defaults: new { controller = "Threads", action = "AnswerThread" }
        );

The "actionUrl" variable in js get´s changed to /threads/answer but I´m always getting 500 Internal Server Error. When I put a breakpoint inside the method it does not stop at any point of the ajax call. 

A: In the Chrome Dev Tools at the "Network" tab it says to me that there is a parameter called "id" which is null which causes to this 500 internal server error. I tried to find out more information about this but the error does not tell me where this parameter is located. 
I´ve got no parameter called "id" inside this method or the data model so where does this come from? 
Solution:
My Routes mapping was bad. I first mapped the route /threads/{id} and THEN did /threads/answer so when the /threads/answer got called it thought "answer" is an id so it tried to enter the "Index" method. So for my particular problem (and maybe for some other guys having the same issue) the solution was just to put the mapping of the /threads/answer route in front of the /threads/{id} route and it worked. 

A: Please check your parameter types, in controller threadId is int type and from ajax call you are passing string type.
In Js
 $("#answer_button").click(function () {
    showLoadingTab();
    var actionUrl = '@Url.Action("AnswerThread", "Home")';
    var threadId = parseInt($("#threadId").val());
    var msg = "Answer message";

    alert(threadId);
    $.ajax({
        url: actionUrl,
        type: "POST",
        data: { Message: msg, threadId: threadId },
        success: function (msg) {
            hideLoadingTab();
            location.reload();
        },
        error: function () {
            alert("Ein Fehler ist aufgetreten.");
            hideLoadingTab();
        }
    });
});

In Controller
    [HttpPost]
    public ActionResult AnswerThread(string Message, int threadId)
    {
        return Json("Data");
    }

