Say I called Index() from the HomeController which returns the view Index.aspx, can jquery ajax in javascript on Index.aspx call a method in another controller (ExternalController)?
$.ajax({
type: "POST",
url: "/Home/sayHi",
dataType: "json",
data:({ currRow : centerPost[0], offset : ((-1 * Math.ceil(numRows / 2)) + 1) }),
error:function(request){alert(request.statusText)},
success:function(result){alert(result)}
}).responseText;
gave me no error, the page was rendered from the HomeController
$.ajax({
type: "POST",
url: "/Row/getRowName",
dataType: "json",
data:({ currRow : centerPost[0], offset : ((-1 * Math.ceil(numRows / 2)) + 1) }),
error:function(request){alert(request.statusText)},
success:function(result){alert(result)}
}).responseText;
gave me an Internal Server Error...
just wondering if it could be because I'm calling a different Controller than the one the View was rendered from