Hi,
How do I go about calling a method on an ASP.NET Web Form page using the getJSON method on jQuery?
The goal is this:
- User clicks on a list item
- The value is sent to the server
- Server responds with related list of stuff, formatted using JSON
- Populate secondary box
I don't want to use an UpdatePanel, I've done this hundreds on times using the ASP.NET MVC Framework, but can't figure it out using Web Forms!
So far, I can do everything, including calling the server, it just doesn't call the right method.
Thanks,
Kieron
Some code:
jQuery(document).ready(function() {
jQuery("#<%= AreaListBox.ClientID %>").click(function() {
updateRegions(jQuery(this).val());
});
});
function updateRegions(areaId) {
jQuery.getJSON('/Locations.aspx/GetRegions',
{ areaId: areaId },
function (data, textStatus) {
debugger;
});
}