Skip to content Skip to sidebar Skip to footer

Json: 500 (internal Server Server Error) In .net Mvc3

I'm trying to get some JSON functionality to work, it's basically as simple as it can be but for some reason I'm getting a 500 Internal server error on my console and the applicati

Solution 1:

You probably just need to add an empty constructor to the OptionsModel class. MVC can't instantiate the class without an empty constructor.

Solution 2:

@scottm got the major problem.

That said:

You probably need to tell jQuery you're expecting to get a json object:

$.post("/Account/ChangeOptionForAdvisor", OptionsModel, function (data) {...});

To this:

$.post("/Account/ChangeOptionForAdvisor", OptionsModel, function (data) {
    ...}, 'json'); //<======

Post a Comment for "Json: 500 (internal Server Server Error) In .net Mvc3"