var xmlhttp; ///////////////////////////////////////////////////////////////// //fillGrid //This Function Takes three parameters //first parameter is the id of a DIV tag to which you want //to populate the Grid //Second Paramaeter is the Sql String //Third Parameter is the selected page index ///////////////////////////////////////////////////////////////// var ph; var fillGrid_Str_SQL=""; var currentPageIndex ; function fillGrid(myPH,str_Sql,pageIndex){ ph = window.document.getElementById(myPH); fillGrid_Str_SQL = str_Sql; currentPageIndex = pageIndex; var url ="http://localhost/GenricAjaxWS/GenricAjaxWS"+ ".asmx/getGrid?sqlStr="+str_Sql+ "&pageIndex="+pageIndex; if(window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=fillGrid_Change; xmlhttp.open("GET",url,true); xmlhttp.send(null); } //code for IE elseif (window.ActiveXObject) { try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){} } if(xmlhttp) { try { xmlhttp.onreadystatechange=fillGrid_Change; xmlhttp.open("GET",url,false); xmlhttp.send(); } catch(e){} } } } ///////////////////////////////////////////////////////////// //fillGrid_Change ///////////////////////////////////////////////////////////// function fillGrid_Change() { if(xmlhttp.readyState==4&&xmlhttp.status==200) { //var rows=xmlhttp.responseXML. // selectNodes(".//TahaSchema//TahaTable"); var row = xmlhttp.responseXML.selectNodes(".//"); ph.innerHTML = row[1].text; } } function goToPage(pageIndex){ fillGrid(ph.id,fillGrid_Str_SQL,pageIndex) } function goToNextPage(){ try{ fillGrid(ph.id,fillGrid_Str_SQL, parseInt(currentPageIndex)+1); returnfalse; } catch(e){ returntrue; } } function goToPrevPage(){ fillGrid(ph.id,fillGrid_Str_SQL, parseInt(currentPageIndex)-1) }