I created the following code in a javascript file.
On the ServerGateway.aspx page load, I do some logic, and want to return that data to the calling javascript.
I have searched online, but fail to find logic to return the data.
Does anyone have any idea how to do this?
Code:
function ajaxToCSharp() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("centerStage").innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("GET", "ServerGateway.aspx", true);
xmlhttp.send();
}