var xmlhttp; www.ossforge.com
///////////////////////////////////////////////////////////////// 中国开源社区
//填充DataGrid,这个函数有3个参数。
//第一个是包含DataGrid的DIV的ID 中国开源社区
//第二个是查询数据的sql语句 中国开源社区
//第三个是要获取第几页数据 www.ossforge.com
/////////////////////////////////////////////////////////////////
var ph; www.ossforge.com
var fillGrid_Str_SQL=""; www.ossforge.com
var currentPageIndex ;
function fillGrid(myPH,str_Sql,pageIndex){
中国开源社区
ph = window.document.getElementById(myPH); 中国开源社区
fillGrid_Str_SQL = str_Sql; 中国开源社区
currentPageIndex = pageIndex; www.ossforge.com
var url = "http://localhost/GenricAjaxWS/GenricAjaxWS" www.ossforge.com
".asmx/getGrid?sqlStr=" str_Sql www.ossforge.com
"&pageIndex=" pageIndex; www.ossforge.com
if(window.XMLHttpRequest)
中国开源社区
{ 中国开源社区
xmlhttp=new XMLHttpRequest(); www.ossforge.com
xmlhttp.onreadystatechange=fillGrid_Change;
中国开源社区
xmlhttp.open("GET",url,true); www.ossforge.com
xmlhttp.send(null); 中国开源社区
} www.ossforge.com
//code for IE 中国开源社区
else if (window.ActiveXObject)
{ www.ossforge.com
try 中国开源社区
{
中国开源社区
xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");
中国开源社区
} 中国开源社区
catch(e) 中国开源社区
{ 中国开源社区
try 中国开源社区
{
www.ossforge.com
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 中国开源社区
}
catch(e){} www.ossforge.com
} 中国开源社区
if(xmlhttp) 中国开源社区
{
www.ossforge.com
try
中国开源社区
{ www.ossforge.com
xmlhttp.onreadystatechange=fillGrid_Change;
中国开源社区
xmlhttp.open("GET",url,false);
www.ossforge.com
xmlhttp.send();

