客户端回调实现gridView无刷新分页4
点击次数:18 次 发布日期:2008-11-26 11:09:03 作者:源代码网
|
源代码网推荐 源代码网推荐 源代码网推荐 源代码网推荐 <%...@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 源代码网推荐 源代码网推荐 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 源代码网推荐 源代码网推荐 <html xmlns="http://www.w3.org/1999/xhtml" > 源代码网推荐 <head runat="server"> 源代码网推荐 <title>客户端回调</title> 源代码网推荐 <style type="text/CSS">... 源代码网推荐 源代码网推荐 body {...}{ 源代码网推荐 font-size: 12px; 源代码网推荐 color: #525252; 源代码网推荐 } 源代码网推荐 td {...}{ 源代码网推荐 font-size: 12px; 源代码网推荐 color: #525252; 源代码网推荐 } 源代码网推荐 th {...}{ 源代码网推荐 font-size: 12px 源代码网推荐 } 源代码网推荐 a:link {...}{ 源代码网推荐 color: #000000; text-decoration: none 源代码网推荐 } 源代码网推荐 a:visited {...}{ 源代码网推荐 color: #525252; text-decoration: none 源代码网推荐 } 源代码网推荐 a:hover {...}{ 源代码网推荐 color: #0095A7; text-decoration: underline 源代码网推荐 } 源代码网推荐 td.alt_1 {...}{ 源代码网推荐 border-top: 1px solid #d6d6d6; 源代码网推荐 border-right: 1px solid #d6d6d6; 源代码网推荐 font-size:12px; 源代码网推荐 color: #4f6b72; 源代码网推荐 } 源代码网推荐 td.alt_2 {...}{ 源代码网推荐 border-top: 1px solid #d6d6d6; 源代码网推荐 border-right: 1px solid #d6d6d6; 源代码网推荐 } 源代码网推荐 td.alt_3 {...}{ 源代码网推荐 border-left: 1px solid #d6d6d6; 源代码网推荐 border-bottom: 1px solid #d6d6d6; 源代码网推荐 } 源代码网推荐 td.alt_4 {...}{ 源代码网推荐 border-left: 1px solid #d6d6d6; 源代码网推荐 border-right: 1px solid #d6d6d6; 源代码网推荐 } 源代码网推荐 </style> 源代码网推荐 源代码网推荐 <script type="text/javascript">... 源代码网推荐 //author: EvoRul date:2007-03-25 源代码网推荐 var PageIndex=1; 源代码网推荐 源代码网推荐 function QueryServer(objOperator,objStartTime,objEndTime,intIndex,boolReset) 源代码网推荐 ...{ 源代码网推荐 context = gridspan; 源代码网推荐 context.innerHTML = "<IMG SRC="http://www.zzchn.com/edu/20080727/../images/pie.gif" />数据加载中..."; 源代码网推荐 arg = "ServerMethodQuery|" + objOperator.value.replace(/$/g,"")+"$"+ objStartTime.value.replace(/$/g,"")+"$"+ objEndTime.value.replace(/$/g,"") +"$"+ intIndex.toString().replace(/$/g,"")+"$"+ boolReset.toString().replace(/$/g,""); 源代码网推荐 <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context")%>; 源代码网推荐 源代码网推荐 } 源代码网推荐 源代码网推荐 function ReceiveServerData(result, context) 源代码网推荐 ...{ 源代码网推荐 context.innerHTML = (result.split("$"))[0]; 源代码网推荐 var t1=document.getElementById("RecordSum"); 源代码网推荐 var t2=document.getElementById("PageSum"); 源代码网推荐 var t3=document.getElementById("CurrentPage"); 源代码网推荐 var t5=document.getElementById("LinkUp"); 源代码网推荐 var t6=document.getElementById("Linkdown"); 源代码网推荐 源代码网推荐 var t7=document.getElementById("DownListIndex"); 源代码网推荐 源代码网推荐 t1.innerHTML = (result.split("$"))[1]; 源代码网推荐 t2.innerHTML = (result.split("$"))[2]; 源代码网推荐 t3.innerHTML = (result.split("$"))[3]; 源代码网推荐 源代码网推荐 PageIndex=eval((result.split("$"))[3]); 源代码网推荐 源代码网推荐 if(PageIndex>1) 源代码网推荐 ...{ 源代码网推荐 t5.innerHTML="<a href="#" onclick="QueryServer(txtOperator,TxtStartTime,TxtEndTime,"+(PageIndex-1).toString()+","false")">上一页</a>"; 源代码网推荐 } 源代码网推荐 else 源代码网推荐 t5.innerHTML = "上一页"; 源代码网推荐 源代码网推荐 if(PageIndex< eval((result.split("$"))[2])) 源代码网推荐 ...{ 源代码网推荐 t6.innerHTML="<a href="#" onclick="QueryServer(txtOperator,TxtStartTime,TxtEndTime,"+(PageIndex+1).toString()+","false")">下一页</a>"; 源代码网推荐 } 源代码网推荐 else 源代码网推荐 t6.innerHTML="下一页"; 源代码网推荐 源代码网推荐 源代码网推荐 if(result.split("$").length>4) 源代码网推荐 ...{ 源代码网推荐 var t4=document.getElementById("SpanIndex"); 源代码网推荐 t4.innerHTML = (result.split("$"))[4]; 源代码网推荐 } 源代码网推荐 源代码网推荐 t7.value=PageIndex; 源代码网推荐 } 源代码网推荐 源代码网推荐 function functionPageload() 源代码网推荐 ...{ 源代码网推荐 if(document.readyState!="complete") return; 源代码网推荐 context = gridspan; 源代码网推荐 arg = "ServerMethodQuery|" +"$"+"1753-1-1"+ "$"+"9999-12-31"+ "$"+ "1"+"$"+ "true"; 源代码网推荐 <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context")%>; 源代码网推荐 //页面加载完后执行的代码 源代码网推荐 } 源代码网推荐 源代码网推荐 //页面加载状态改变时执行的方法 源代码网推荐 document.onreadystatechange=functionPageload; 源代码网推荐 </script> 源代码网推荐 </head> 源代码网推荐 <body> 源代码网推荐 <form id="form1" runat="server"> 源代码网推荐 <div> 源代码网推荐 <table style="width:100%; background-color:#ffffff; margin: 0px;" cellpadding="0" cellspacing="0" border="0" id="table1"> 源代码网推荐 <tr> 源代码网推荐 <td style="width:102%; height: 445px;" align="center" valign="top"> 源代码网推荐 <br /> 源代码网推荐 <table cellpadding="0" cellspacing="0" border="0" width="95%"> 源代码网推荐 <tr> 源代码网推荐 <td><img src="http://www.zzchn.com/edu/20080727/../images/round-1.gif" width="13" height="30" alt="" /></td> 源代码网推荐 <td style="width:100%;background-color:#efefef;" class="alt_1"> 源代码网推荐 日志查询</td> 源代码网推荐 </tr> 源代码网推荐 <tr> 源代码网推荐 <td class="alt_4" valign="top" colspan="2" align="center"> 源代码网推荐 <table cellpadding="0" cellspacing="0" border="0" width="95%"> 源代码网推荐 <tr> 源代码网推荐 <td style="width:120px; height:30px;" align="right"> 源代码网推荐 操作人员:</td> 源代码网推荐 <td align="left" style="width: 143px"> 源代码网推荐 <asp:TextBox ID="txtOperator" runat="server" CssClass="border" ReadOnly="False" 源代码网推荐 Width="90px"></asp:TextBox></td> 源代码网推荐 <td style="width:71px; height:30px;" align="right"> 源代码网推荐 操作时间:</td> 源代码网推荐 <td align="left"> 源代码网推荐 <asp:TextBox ID="TxtStartTime" runat="server" CssClass="border" 源代码网推荐 ReadOnly="False" Width="90px"></asp:TextBox>-<asp:TextBox 源代码网推荐 ID="TxtEndTime" runat="server" CssClass="border" 源代码网推荐 ReadOnly="False" Width="90px"></asp:TextBox></td> 源代码网推荐 </tr> 源代码网推荐 <tr> 源代码网推荐 <td colspan="4" style="background-image:url(../images/point.gif); height:12px;"></td> 源代码网推荐 </tr> 源代码网推荐 <tr> 源代码网推荐 <td colspan="4" style="height:30px; text-align: center;"> 源代码网推荐 <asp:Button ID="Submit" runat="server" CssClass="btn2" Text=" 确定 " Height="20px" Width="50px" /></td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 </td> 源代码网推荐 </tr> 源代码网推荐 <tr> 源代码网推荐 <td colspan="2" align="center"> 源代码网推荐 <table cellpadding="0" cellspacing="0" border="0" width="100%"> 源代码网推荐 <tr> 源代码网推荐 <td style="width:100%;" class="alt_3"> </td> 源代码网推荐 <td></td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 </td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 <span id="gridspan"> 源代码网推荐 <asp:GridView ID="Logs" runat="server" AutoGenerateColumns="False" 源代码网推荐 GridLines="Horizontal" PageSize="15" 源代码网推荐 Width="95%" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4"> 源代码网推荐 <RowStyle ForeColor="#333333" Height="24px" BackColor="White" /> 源代码网推荐 <SelectedRowStyle BorderColor="Red" BackColor="#339966" Font-Bold="True" ForeColor="White" /> 源代码网推荐 <HeaderStyle BackColor="#336666" ForeColor="White" Height="30px" Font-Bold="True" /> 源代码网推荐 <AlternatingRowStyle BorderWidth="1px" /> 源代码网推荐 <Columns> 源代码网推荐 <asp:TemplateField HeaderText="用户"> 源代码网推荐 <ItemTemplate> 源代码网推荐 <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="" Text="<%# Eval("UserInfo.Name") %>"></asp:HyperLink> 源代码网推荐 </ItemTemplate> 源代码网推荐 </asp:TemplateField> 源代码网推荐 <asp:TemplateField HeaderText="类型"> 源代码网推荐 <ItemTemplate> 源代码网推荐 <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="" Text="<%# Eval("Type.Name") %>"></asp:HyperLink> 源代码网推荐 </ItemTemplate> 源代码网推荐 </asp:TemplateField> 源代码网推荐 <asp:TemplateField HeaderText="时间"> 源代码网推荐 <ItemTemplate> 源代码网推荐 <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="" Text="<%# Eval("Time") %>"></asp:HyperLink> 源代码网推荐 </ItemTemplate> 源代码网推荐 </asp:TemplateField> 源代码网推荐 <asp:TemplateField HeaderText="备注"> 源代码网推荐 <ItemTemplate> 源代码网推荐 <asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="" Text="<%# Eval("Info") %>"></asp:HyperLink> 源代码网推荐 </ItemTemplate> 源代码网推荐 </asp:TemplateField> 源代码网推荐 </Columns> 源代码网推荐 <FooterStyle BackColor="White" ForeColor="#333333" /> 源代码网推荐 <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" /> 源代码网推荐 </asp:GridView> 源代码网推荐 </span> 源代码网推荐 <table border="0" cellpadding="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#ffffff"> 源代码网推荐 <tr> 源代码网推荐 <td align="center" nowrap style="height: 25px; width: 601px;"> 源代码网推荐 共有<asp:Label ID="RecordSum" runat="server" />条<asp:Label ID="PageSum" runat="server" />页结果 源代码网推荐 当前显示为第<asp:Label ID="CurrentPage" runat="server" />页 15条/页 源代码网推荐 <asp:Label ID="LinkUp" runat="server" >上一页</asp:Label> 源代码网推荐 <asp:Label ID="Linkdown" runat="server" >下一页</asp:Label> 源代码网推荐 跳转至第<span id="SpanIndex"><asp:DropDownList ID="DownListIndex" runat="server" Width="50px"> 源代码网推荐 </asp:DropDownList></span>页 源代码网推荐 </td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 源代码网推荐 <asp:ObjectDataSource ID="DataSourceLog" runat="server" TypeName="DataLogic" SelectMethod="GetLogData"> 源代码网推荐 <SelectParameters> 源代码网推荐 <asp:ControlParameter ControlID="txtOperator" DefaultValue=" " Name="strOperator" PropertyName="Text" 源代码网推荐 Type="string" /> 源代码网推荐 <asp:ControlParameter ControlID="TxtStartTime" DefaultValue="1753-1-1" Name="dtStarTime" 源代码网推荐 PropertyName="Text" Type="DateTime" /> 源代码网推荐 <asp:ControlParameter ControlID="TxtEndTime" DefaultValue="9999-12-31" Name="dtEndTime" 源代码网推荐 PropertyName="Text" Type="DateTime" /> 源代码网推荐 <asp:ControlParameter Name="Pageid" ControlID="DownListIndex" DefaultValue="1" PropertyName="SelectedValue" Type="String" /> 源代码网推荐 </SelectParameters> 源代码网推荐 </asp:ObjectDataSource> 源代码网推荐 源代码网推荐 </td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 源代码网推荐 </div> 源代码网推荐 </form> 源代码网推荐 </body> 源代码网推荐 </html> 源代码网推荐 源代码网推荐 做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。 源代码网推荐 源代码网供稿. |
