AJAX Callback using POST method

iwaniwan

New Member
I require some assistance. I am using jQuery to cause an ajax callback:\[code\]function TestingCallback(controlId) { if (controlId == 'drpControl') { var options = { type: "POST", url: "Main.aspx", data: { drpControl: $(".drpControl").val() }, //contentType: "application/json; charset=utf-8", //cache: false, success: function (data) { }, complete: function (jqXHR, status) { formData = http://stackoverflow.com/questions/15630120/$("#form1").serialize(); window.location = "Main.aspx?" + formData; ShowLoadingBar(); return false; } }; var resp = $.ajax(options); }}\[/code\]And the backend I get the data like so:\[code\]Request.Form["drpControl"]\[/code\], which works well.But as soon as I add this line to the callback options : \[code\]contentType: "application/json; charset=utf-8",\[/code\], I get a value of null for \[code\]Request.Form["drpControl"]\[/code\].Please assist on how to overcome this.Thanks in advanceMight I just add that I am trying to cause a postback but keep all control values, hence this line :\[code\] formData = http://stackoverflow.com/questions/15630120/$("#form1").serialize(); window.location = "Main.aspx?" + formData;\[/code\]But after a second postback (on change of drpControl) field values gets cleared, I am assuming this has to do with IE not being able to cater for a long querystring, I have tested it in Chrome and it works perfect, but not IE, and I need it to work for IE 8.Any suggestions?
 
Back
Top