<Script language = "JavaScript">
VaR XMLHttpRequest = NULL;
Function selectionchanged (){
// Ie only.
XMLHttpRequest = new activexobject ("msxml2.xmlhttp ");
String = "objstr = 1 ";
// Send data
XMLHttpRequest. Open ("Post", "a. aspx", false); // submit to a. aspx
XMLHttpRequest. setRequestHeader ("Content-Length", String. Length );
XMLHttpRequest. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded ");
XMLHttpRequest. Send (string );
XMLHttpRequest. onreadystatechange = onreadystatechange;
}
Function onreadystatechange (){
If (XMLHttpRequest. readystate = 4 ){
If (XMLHttpRequest. Status = 200 ){
VaR W = XMLHttpRequest. responsetext;
}
}
}
</SCRIPT>
Protected void page_load (Object sender, eventargs E)
{
Response. contenttype = "text/plain ";
String objstr = request. Form ["objstr"]. tostring ();
Response. Write ("Hello World" + objstr );
Response. End ();
}
In addition, Ajax does not support cross-origin submission, which should be the permission of the browser.