Hi
I created a mvc3 application.in which the below method inside HomeController.cs.
public JsonResult StringReturn()
{
string s="hai";
return Json(s);
}
then calling the above method from views/Home/Index.cshtml using
jquery as below
function GetString() {
$.ajax({
type: "POST",
url: "Home/StringReturn",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: '{}',
error: function (jqXhr, textStatus, errorThrown) {
alert("Error '" + jqXhr.status + "' (textStatus: '" + textStatus + "', errorThrown: '" + errorThrown + "')");
},
success: function (result, textStatus) {
alert(result);
}
});
}
it work when i run it from visual studio.but getting error message 'Error 405(textStatus:'error',errorThrown:'undefined')'
when i browse it from hosted iis.how to resolve this?
thanks..