110,539
社区成员
发帖
与我相关
我的任务
分享
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" PageSize="13" Width="99%" DataKeyNames="BriefingID" OnPageIndexChanging="GridView1_PageIndexChanging" AllowSorting="True" OnSorting="GridView1_Sorting" EmptyDataText="没有任何数据">
<Columns>
<asp:BoundField DataField="BriefingID" Visible="False"/>
<asp:BoundField DataField="UserName" HeaderText="发布者" SortExpression="UserName" Visible="False">
<ItemStyle HorizontalAlign="Center" Wrap="False"/>
</asp:BoundField>
<asp:TemplateField HeaderText="标 题" SortExpression="Title">
<ItemTemplate>
<a style='color:Blue;display:<%# (Eval("State").ToString()=="1" && Eval("RecState").ToString()=="0")?" ":"none" %>' href='BriefingDetail.aspx?id=<%# Eval("BriefingID") %>' ><%# Eval("Title").ToString().Length > 20 ? Eval("Title").ToString().Substring(0,20) + "..." : Eval("Title").ToString() %><img border="0" src="../../images/newAlert.GIF" /></a>
<a style='display:<%# (Eval("State").ToString()!="1" || Eval("RecState").ToString()!="0")?" ":"none" %>' href='BriefingDetail.aspx?id=<%# Eval("BriefingID") %>' ><%# Eval("Title").ToString().Length > 20 ? Eval("Title").ToString().Substring(0,20) + "..." : Eval("Title").ToString() %></a>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Wrap="False"/>
</asp:TemplateField>
<asp:TemplateField HeaderText="类型" SortExpression="ClassifyID">
<ItemStyle HorizontalAlign="Center" Wrap="False"/>
<ItemTemplate>
<span><%# GetClassifyName(Eval("ClassifyID").ToString())%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SendDate" HeaderText="发布日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="SendDate desc">
<ItemStyle HorizontalAlign="Center" Width="100px" Wrap="False"/>
</asp:BoundField>
<asp:TemplateField Visible="False">
<ItemTemplate>
<a style=display:<%# Eval("State").ToString()=="0"?" ":"none" %> href=<%# "BriefingManage.aspx?Operation=Edit&id="+Eval("BriefingID") %> >修改</a>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False"/>
</asp:TemplateField>
<asp:TemplateField></asp:TemplateField>
</Columns>
<pagertemplate>
<table width="100%">
<tr>
<td style="text-align:right">
每页<%# ((GridView)Container.Parent.Parent).PageSize %>条
第<asp:Label id="lblPageIndex" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' />/<asp:Label id="lblPageCount" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageCount %>' />页
<asp:linkbutton id="btnFirst" runat="server" Enabled='<%# ((GridView)Container.Parent.Parent).PageIndex != 0 %>' causesvalidation="False" commandargument="First" commandname="Page" text="首页" />
<asp:linkbutton id="btnPrev" runat="server" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex != 0 %>" causesvalidation="False" commandargument="Prev" commandname="Page" text="上一页" />
<asp:linkbutton id="btnNext" runat="server" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex+1 != ((GridView)Container.Parent.Parent).PageCount %>" causesvalidation="False" commandargument="Next" commandname="Page" text="下一页" />
<asp:linkbutton id="btnLast" runat="server" Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex+1 != ((GridView)Container.Parent.Parent).PageCount %>" causesvalidation="False" commandargument="Last" commandname="Page" text="尾页" />
转到<asp:textbox id="txtNewPageIndex" runat="server" width="20px" text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' />
<asp:linkbutton id="btnGo" runat="server" causesvalidation="False" commandargument="-1" commandname="Page" text="GO" />
</td>
</tr>
</table>
</pagertemplate>
</asp:GridView>