asp.net - JQuery Post URL -
i have following jquery function
function refreshthegrid(mydata, ceduledatefrom, ceduledateto, paramorderno) { var mydata2 = { ceduledatefrom: ceduledatefrom, ceduledateto: ceduledateto, paramorderno: paramorderno }; var theurl = "updatecheckbox"; var theurl2 = ""; $.ajax({ type: "post", url: theurl, data: mydata, datatype: "text", success: function (data) { $.ajax({ type: "post", url: theurl2, data: mydata2, datatype: "text", success: function (data) { $('#monbouton').click(); } }) } }) popup.hide(); void (0); }
my application http://localhost/jprmvc/
when post method called following capture fiddler2
post /jprmvc/ceduleglobale/updatecheckbox http/1.1
and
post /jprmvc/ http/1.1
i had problem call until removed ceduleglobale part url. works.
i think it's routing problem, not sure.
my routing
routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "ceduleglobale", action = "index", id = urlparameter.optional } // parameter defaults );
it works now, seems arbitrary.
should remove defaults routing , put in jquery.
what missing ?
i leave routing default , change controller in jquery call.
routing code
routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults );
jquery code
$.ajax({ type: 'get', datatype: 'json', timeout: 300000, //5 minutes (in milliseconds) url: '/yourapplicationname/yourcontollername/yourmethodname', //...
Comments
Post a Comment