I have implemented the solution on this link to my project to have jsonp capabilities:
http://blogorama.nerdworks.in/entry-EnablingJSONPcallsonASPNETMVC.aspx
It is working like a charm on first calls but on second call it is not responding?
Do you have any idea?
My json call is:
$.ajax({
type: "GET",
url: '../../askjson',
data: { name_startsWith: name },
cache: false,
dataType: "jsonp",
success: function (data) { }
});
and controller is:
[HttpGet]
[JsonpFilter]
public JsonResult askjson(string name_startsWith)
{
// do stuff
return Json(resultView, JsonRequestBehavior.AllowGet);
}
Thank you guys.
I’ve traced the error and it was a 400 indicating that: request is over the allowed setting defined at
MaxQueryStringLength.So I’ve added the following to my web.config under
<system.web>I also did same to
<system.webServer>by:my problem has gone!