<script type="text/javascript"> function getajax() { var xhr; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { xhr = new ActiveXObject("Msxml2.XMLHTTP"); document.getElementById("<%=Label1.ClientID%>").innerHTML = "Windows"; } else { throw new Error("Ajax is not supported by this browser"); document.getElementById("<%=Label2.ClientID%>").innerHTML = "Ajax is not supported by this browser"; } xhr.onreadystatechange = function () { if (xhr.readyState == 4) { if (xhr.status >= 200 && xhr.status < 300) { //executes on success document.getElementById("<%=Label3.ClientID%>").innerHTML = "Success"; xhr.open("POST", Default.aspx / GetValue); xhr.send(); } else { //executes on error document.getElementById("<%=Label2.ClientID%>").innerHTML = "Error"; } } } } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)