I have this ajax panel:
<telerik:RadAjaxPanel ID="rap" runat="server">
...
<-- Contains several Hidden fields -->
</telerik:RadAjaxPanel>
In my code behind I have an event handler to handle all ajax requests on the panel with the following signature:
Private Sub rap_AjaxRequest(sender As Object, e As Telerik.Web.UI.AjaxRequestEventArgs) Handles rap.AjaxRequest
I am successfully able to invoke the ajax requests from Javascript like this:
var panel = $find('<%=rap.ClientID%>');
panel.ajaxRequest();
The method calling the ajax request need the value of one of the hidden fields which gets set in the code behind. Doing it like this doesn't push the value through to the client correctly because it is asynchronous. I am trying to use jQuery to trigger the request synchronously like this:
var panel = $find('<%=rap.ClientID%>');
$.ajax({
async: false,
context: panel
}).done(function() {
// Handle the rest of the function if the ajax call succeeded
});
When I step through the code I find that the ajax call succeeds as my .done function is run. However, the method in the code behind to handle the request never gets triggered. How can I get this call to properly trigger the event being handled by my code behind?