I built some "ajax" functions using native javascript in 2006 using VS2005; basically a "core" callback send and receive script (shown below) and then a callback sender and receive router in js, and a callback receive router and replier in vb. There are over a dozen miscellaneous functions that send and receive between client and server through these "utilities", all works fine.
Now I'm refreshing the application using VS2010 Express and trying to figure out how I might better use contemporary AJAX capabilities. Here's the first question:
1) How might I replace this "core" callback and receive script with something that's pre-written from the VS2010 AJAX (or other) library?
Any help with this would be appreciated.
Thanks!
<%-- =====================================================
=======================CALLBACK ROUTINES=============== --%>
<script type="text/javascript">
function CallBackClientSender(varDataString) {
clearTimeout( gvPrompterTimeout)
//alert("at callback sender")
var Command = varDataString;
var context = new Object();
// <050907>
if (gvCallBackInProgress) {
return false
} // <050907>
gvCallBackInProgress = true // <050907>
context.CommandName = "CallBackClientSender";
<%=CallBackSenderSetupString%>
return
}
function CallBackClientReceiver(varCallBackResult, varContext) {
//alert("at callback receiver")
if (varContext.CommandName == "CallBackClientSender" ) {
//alert("calling client-side router")
gvCallBackInProgress = false // <050907>
CallAndPostBackRouter(varCallBackResult)
return
}
}
function onError(message, context) { // This will occur if there's an exception from the server side
CallBackErrorProcessing(message) } // message will be the exception message
</script>