日期:2014-05-17 浏览次数:20572 次
<asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="kaiQ_Table"> <tr> <th width="7%"> 编号</th> <th width="10%">联系人</th> <th width="20%">标题[<span style="color:red;font-size:small">点击标题查看详情</span>]</th> <th width="30%">剩余完成时间</th> <th width="15%">提交时间</th> <th width="15%">状态</th>? </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:Label ID="lblId" runat="server" Text='<%# Eval("id" ) %>'></asp:Label> </td> <td> <asp:Label ID="lblLinkman" runat="server" Text='<%# Eval("t_Linkman" ) %>'></asp:Label> </td> <td> <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("t_Title" ) %>'></asp:Label> </td> <td> 还剩:<asp:Label ID="lblTimeCount" runat="server" Text='<%# Eval("t_TimeCount") %>'></asp:Label> 的时间完成 </td> <td> <asp:Label ID="lalTime" runat="server" Text='<%#Eval("t_Time") %>'></asp:Label> </td> <td> <asp:Label ID="Label3" runat="server" Text='<%# Eval("t_State" ) %>'></asp:Label> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>
void GetSwPage() { lblNull.Visible = false; string sqlPage = "select * from [thing] order by [t_time] desc"; int curpage = Convert.ToInt32(lblPage.Text); PagedDataSource ps = new PagedDataSource(); ps.DataSource = db.ExecDataSet(sqlPage).Tables[0].DefaultView; ps.AllowPaging = true;//是否分页 ps.PageSize = 10; //显示条数 ps.CurrentPageIndex = curpage - 1;//获取当前的页码 lnkbtnUp.Enabled = true; lnkbtnNext.Enabled = true; lnkbtnBack.Enabled = true; lnkbtnOne.Enabled = true; if (curpage == 1) { lnkbtnOne.Enabled = false;//不显示第一页按钮 lnkbtnUp.Enabled = false;//不显示上一页按钮 } if (curpage == ps.PageCount) { lnkbtnNext.Enabled = false;//不显示下一页 lnkbtnBack.Enabled = false;//不显示最后一页 } this.labBackPage.Text = ps.PageCount.ToString(); if (ps.Count < 1) lblNull.Visible = true; this.Repeater1.DataSource = ps; this.Repeater1.DataBind(); }