Instantiating XMLHttpRequest in Asp.Net

Gopesh9
Posted by Gopesh9 under C# category on | Points: 40 | Views : 2428
We know that XMLHttpRequest is one of the main AJAX technologies which the scheduler component of all the AJAX engine uses to make asynchronous requests to the server.So hers the code that how you can instantiate the XMLHttpRequest in Asp.Net, so that you can use it in your code.

if (!window.XMLHttpRequest)
{
window.XMLHttpRequest = function window$XMLHttpRequest()
{
var pID = [ 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP' ];
for (var i = 0; i < pID.length; i++)
{
try
{
var xml = new ActiveXObject(progIDs[i]);
return xml;
}
catch (ex) {}
}
return null;
}
}

Comments or Responses

Login to post response