XMLHttpRequest的问题
WebForm8的页面,里面有一个button(Html控件),DataGrid控件.我想在点了button后就得到数据库中的数据放在datagrid里面.我是这么做的....如下:
function executeXhr()
{
if(window.XMLHttpRequest)
{
req=new XMLHttpRequest();
req.onreadystatechange=ybh();
req.open("GET",url,true);
req.send(null);
}
else
{
req=new ActiveXObject("Microsoft.XMLHTTP");
if(req)
{
req.onreadystatechange=ybh();
req.open("GET","WebForm8.aspx",true);
req.send();
}
}
}
function ybh()
{
alert('我测试一下而以...');
}
我想问一下,req.open("Get","WebForm8.aspx",true) 这里的url是不是该为WebForm8.aspx.那么我在后台得到一个DataSet后,怎样放入这个页面的DataGrid里面(实现不刷新).如果是在ybh()这个函数时面写返回数据的代码,那么该怎么做. 有人给我讲一下吗?谢谢!!!