<%@ Page Language="VB" %>
<html>
<head>
<script>
var req;

function sayHello() {
  var url = "SayHello.aspx";
  req = new ActiveXObject("Microsoft.XMLHTTP");
  req.onreadystatechange = sayHelloCallBack;
  req.open("GET", url, true);
  req.send();
}

function sayHelloCallBack() {
  if (req.readyState == 4) {
    if (req.status == 200) {
      alert(req.responseText);
    }
  }
}

function getXMLHttpRequest() {
  var x = null;
	if (typeof XMLHttpRequest != "undefined") {
		x = new XMLHttpRequest();
	} else {
		try {
			x = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				x = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
			}
		}
	}
	return x;
}
</script>
</head>
<body>
    <form runat="server">
        <h3>Ajax1.aspx</h3>
        <input onclick="sayHello();" type="button" value="Say Hello" />
    </form>
</body>
</html>
