When using Ajax Update panels on a page , simple javascript functions do not work as these scripts are not in the "ScriptManagers pool", to execute ja

function GetData()
{
var xmlHttp = getNewHTTPObject();
var url = "frmAsnc.aspx"; xmlHttp.onreadystatechange = StateChanged;
xmlHttp.open('GET', url, true);
xmlHttp.send(null);
return false;
}
function getNewHTTPObject()
{

if (window.XMLHttpRequest)
{ // Mozilla, Safari,...
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{ // IE
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlHttp;
}

function StateChanged()
{
if(xmlHttp.readyState==4)
{
var result = xmlHttp.responseText;
document.getElementById('TextBox1').value = result;
}

}

Posted in |