HELP! Ajax and jquery

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
RickSilver
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Jun 22, 2009 5:49 pm

HELP! Ajax and jquery

Post by RickSilver » Fri Jan 27, 2017 4:54 pm

I am very familiar with JQuery and ajax and have done what I need in the past but have spent all day trying to get what should be a simple ajax call to not return a 200, 500 or other error within this AC environment!!! :evil: I'm sure it's something stupid I'm missing.

I'm trying to get data for a dropdownlist. Does anyone have working code to share?
Here's just one iteration of what I've tried. It should just return the input string back. Instead I get 500/Internal Server Errror.

aspx file:

$.ajax({
type: "GET",
cache: false,
url: "Custom.aspx/GetShippingMethods",
data: {"addressText": addressText},
contentType: "application/json",
dataType: "json",
success: function (data) {
alert('success:' + data);
},
error: function(data) {
alert(data.status + "/" + data.statusText)
}
});


code behind:

[WebMethod]
public static string GetShippingMethods(string addressText)
{
return addressText;
}

mike92117
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Sat Nov 07, 2009 6:41 pm

Re: HELP! Ajax and jquery

Post by mike92117 » Fri Jan 27, 2017 9:01 pm

Whenever I run into this sort of thing, my go-to tools are chrome and use the tools (f10) to see what's occurring client-side and for server-side, I rely on Fiddler.

Post Reply