View Full Version : AJAX and ASP.NET Web Method Problem

07-28-2010, 05:21 PM
I have an application which has been using JQuery AJAX and VB.NET Web Methods just fine in an earlier version of IIS. I have recently moved over to IIS7 and now i am getting ajax errors. It seems like no data is getting sent to the web methods...

Here is a code snippet of my ajax:

function doAjax(_url, _name, _dataToSend, _sFunc){
type: "POST",
async: false,
url: _url + "/" + _name + "/",
data: "{'text':'" + _dataToSend + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg){ _sFunc(msg.d); },
error:function (xhr, ajaxOptions, thrownError){
if(SHOW_AJAX_ERRORS) alert(_name + "_ERROR ::: " + xhr.status);

And i just fill in the function with my needed parameters for each us of it.

Anyways, the problem is, is that it is always going to the error function.

Anyone have any idea???


07-29-2010, 06:44 PM
More info on the problem, when i change the data type of the ajax request to "html", the doAjax method does return a success, but it returns the whole page as a message. I do not think it is even touching my web method in the code behind file.