ListView.aspx
上传用户:xuming1973
上传日期:2014-02-27
资源大小:17511k
文件大小:10k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="ListView.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.BBS.ListView" %>
  2. <%@ Import namespace="System"%>
  3. <%@ Import namespace="System.Data"  %>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  5. <HTML>
  6. <HEAD>
  7. <title>ListView</title>
  8. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  9. <meta content="C#" name="CODE_LANGUAGE">
  10. <meta content="JavaScript" name="vs_defaultClientScript">
  11. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  12. <LINK href="../../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  13. <script language="JavaScript">
  14. <!--
  15. var bSubmited = false;
  16. // 高亮背景
  17. function high( which )
  18. which.style.background = "";
  19. which.style.font.color = "red";
  20. // 取消背景高亮
  21. function low( which )
  22. which.style.background = "";
  23. which.style.font.color = "black";
  24. }
  25. function MM_openBrWindow(theURL,winName,features) { //v2.0
  26.   window.open(theURL,winName,features);
  27. }
  28. function SubmitCurrentPage( )
  29. {
  30. }
  31. function OnChangePageInfo( )
  32. {
  33. if( navigator.appName == "Netscape" )
  34. {
  35. if( e.which == 13 )
  36. {
  37. SubmitCurrentPage( );
  38. }
  39. }
  40. else
  41. {
  42. if( event.keyCode == 13 )
  43. {
  44. SubmitCurrentPage( );
  45. }
  46. }
  47. }
  48. function SubmitForm( BtObject )
  49. {
  50. if( bSubmited == false )
  51. {
  52. bSubmited = true;
  53. BtObject.disabled = true;
  54. BtObject.title = "正在处理数据,请稍等……";
  55. BtObject.value = "处理中";
  56. fmAdminPanel.submit( );
  57. }
  58. }
  59. //-->
  60. </script>
  61. <script language="C#" runat="server">
  62. private string GetImagePath(string hittimes,string sysbulletin,string bulletin)
  63. {
  64. if(sysbulletin=="True")
  65. {
  66. return("../../../images/sysbulletin.gif");
  67. }
  68. else if(bulletin=="True")
  69. {
  70. return("../../../images/bulletin.gif");
  71. }
  72. else if(hittimes!="")
  73. {
  74. if(Int32.Parse(hittimes) > hotitemhittimes)
  75. return("../../../images/hotfolder.gif");
  76. else
  77. return("../../../images/folder.gif");
  78. }
  79. else
  80. return("../../../images/folder.gif");
  81. private string GetImageAlt(string hittimes)
  82. {
  83. if(hittimes!="")
  84. {
  85. if(Int32.Parse(hittimes) > hotitemhittimes)
  86. return("热门贴");
  87. else
  88. return("一般贴");
  89. }
  90. return("一般贴");
  91. }
  92. </script>
  93. </HEAD>
  94. <body topmargin=0 leftmargin=0>
  95. <form id="ListView" method="post" runat="server">
  96. <table  width="100%" border="0" cellpadding="0" cellspacing="0">
  97. <tr>
  98. <td background="../../../Images/bbsback.jpg"><img src="../../../Images/bbs.jpg"></td><td background="../../../Images/bbsback.jpg"><br><font color=white>|</font> <a  style="color: #ffffff;" href='<%="search/index.aspx?classid="+classid%>'>搜索</a> <font color=white>|</font></td>
  99. </tr>
  100. </table><br>
  101. <table id="AutoNumber4" style="BORDER-COLLAPSE: collapse" borderColor="#111111" height="1" cellSpacing="0" cellPadding="0" width="100%" border="0">
  102. <tr>
  103. <td class="BlueTextBX" align="middle" height="1"><asp:Label ID="lblBoardName" Runat="server" Font-Bold="true" Font-Underline="false"></asp:Label></td>
  104. <td class="BlueTextBX" align="right" height="1"><input type=button onclick="window.open('NewItem.aspx?BoardID=<%=boardid%>');" value="发送新贴" class=redbuttoncss></td>
  105. </tr>
  106. <tr>
  107. <td colspan=2>
  108. <table width=100%>
  109. <tr>
  110. <td width=10%  style="FONT-SIZE: x-small">系统公告:</td>
  111. <td style="FONT-SIZE: x-small">
  112. <marquee behavior=scroll scrollamount=5 loop=0  onmouseover="this.stop()" onmouseout="this.start();" direction=left  id="sys_bulletin" runat=server></marquee>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td style="FONT-SIZE: x-small">本版公告:</td>
  117. <td style="FONT-SIZE: x-small">
  118. <marquee  behavior=scroll scrollamount=10 loop=0  onmouseover="this.stop()" onmouseout="this.start();" direction=left  id="mar_bulletin" runat=server></marquee>
  119. </td>
  120. </tr>
  121. </table>
  122. </td>
  123. </tr>
  124. </table>
  125. <asp:datagrid id="ItemList" runat="server" AllowPaging="True" PageSize="15" CellPadding="3" Width="100%" AutoGenerateColumns="False" DataKeyField="item_id" BorderColor=#93BEE2 OnPageIndexChanged = "ItemList_PageIndexChanged" >
  126. <HeaderStyle Font-Size="X-Small" HorizontalAlign="Center" Height="10px" ForeColor="White" VerticalAlign="Top" BackColor="#337FB2"></HeaderStyle>
  127. <AlternatingItemStyle BackColor="#E8F4FF"></AlternatingItemStyle>
  128. <ItemStyle HorizontalAlign="Center" ForeColor="Black" VerticalAlign="Middle" BackColor="White" Font-Size="X-Small"></ItemStyle>
  129. <Columns>
  130. <asp:TemplateColumn HeaderText="状态">
  131. <HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
  132. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  133. <ItemTemplate>
  134. <img id="image" src='<%# GetImagePath(DataBinder.Eval(Container.DataItem,"hit_times").ToString(),(DataBinder.Eval(Container.DataItem,"sysbulletin").ToString()),(DataBinder.Eval(Container.DataItem,"bulletin").ToString()))%>' runat=server/>
  135. </ItemTemplate>
  136. </asp:TemplateColumn>
  137. <asp:TemplateColumn HeaderText="贴子主题">
  138. <ItemStyle HorizontalAlign=Left></ItemStyle>
  139. <ItemTemplate>
  140. <a onclick="javascript:window.open('display.aspx?ItemID=<%# DataBinder.Eval(Container, "DataItem.item_id") %>&BoardID=<%=boardid%>','_blank','')" href="#" >
  141. <%# DataBinder.Eval(Container, "DataItem.title") %>
  142. </a>
  143. </ItemTemplate>
  144. <EditItemTemplate>
  145. <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>'>
  146. </asp:TextBox>
  147. </EditItemTemplate>
  148. </asp:TemplateColumn>
  149. <asp:BoundColumn DataField="sender" HeaderText="发布人">
  150. <HeaderStyle Width="10%"></HeaderStyle>
  151. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  152. </asp:BoundColumn>
  153. <asp:BoundColumn DataField="send_time" HeaderText="发布时间">
  154. <HeaderStyle Width="20%"></HeaderStyle>
  155. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  156. </asp:BoundColumn>
  157. <asp:BoundColumn DataField="last_replayer" HeaderText="最后回复">
  158. <HeaderStyle Width="10%"></HeaderStyle>
  159. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  160. </asp:BoundColumn>
  161. <asp:BoundColumn DataField="last_replay_time" HeaderText="最后回复时间">
  162. <HeaderStyle Width="20%"></HeaderStyle>
  163. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  164. </asp:BoundColumn>
  165. <asp:TemplateColumn HeaderText="人气">
  166. <HeaderStyle Width="10%"></HeaderStyle>
  167. <ItemStyle HorizontalAlign="Center"></ItemStyle>
  168. <ItemTemplate>
  169. <%# DataBinder.Eval(Container.DataItem,"replay_times")%>
  170. <asp:Label Runat="server" ID="bias" Text="/"></asp:Label><%# DataBinder.Eval(Container.DataItem,"hit_times")%>
  171. </ItemTemplate>
  172. </asp:TemplateColumn>
  173. </Columns>
  174. <PagerStyle Font-Size="12px" BorderStyle="Dotted" HorizontalAlign="Right" ForeColor="#337FB2" BackColor="#e8f4ff" Mode="NumericPages" ></PagerStyle>
  175. </asp:datagrid>
  176. <table width=100%>
  177. <tr>
  178. <!--
  179. <td class="GbText" style="HEIGHT: 31px" width="83%" bgColor="#c0d9e6" height="31">&nbsp;<input class="ButtonCss" id="btn_Go" style="WIDTH: 36px; HEIGHT: 20px" type="button" value="转到" name="btn_Go" runat="server">
  180. 第<asp:textbox id="txb_PageNo" onmouseover="high( this );this.select();" onmouseout="low( this );this.blur();" Width="20" TextMode="SingleLine" CssClass="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #fffffb 1px solid; BORDER-LEFT: #ffffff 1px solid; COLOR: #5e5e5e; BORDER-BOTTOM: #ffffff 1px solid; TEXT-ALIGN: center" Runat="server"></asp:textbox>
  181. 页,每页显示<asp:textbox onkeypress="if(event.keycode==13) ListView.submit();" id="txb_ItemPerPage" onmouseover="high( this );this.select();" onmouseout="low( this );this.blur();" Width="20" TextMode="SingleLine" CssClass="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #fffffb 1px solid; BORDER-LEFT: #ffffff 1px solid; COLOR: #5e5e5e; BORDER-BOTTOM: #ffffff 1px solid; TEXT-ALIGN: center" Runat="server"></asp:textbox>条记录,共有
  182. <asp:label id="lbl_totalrecord" runat="server" Width="10px" Height="8px"></asp:label>页记录.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  183. </td>
  184. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_first" runat="server" Width="23" Height="23" ToolTip="第一页" CommandArgument="first" ImageUrl="../../../Images/top.gif" BorderWidth="0"></asp:imagebutton></td>
  185. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_pre" Width="23" Runat="server" ToolTip="前一页" CommandArgument="pre" ImageUrl="../../../Images/prev.gif" BorderWidth="0"></asp:imagebutton></td>
  186. <td class="GbText" style="HEIGHT: 31px" align="middle" width="8%" height="31"><asp:label id="lbl_curpage" runat="server">Label</asp:label>/
  187. <asp:label id="lbl_totalpage" runat="server">Label</asp:label></td>
  188. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_next" Width="23" Runat="server" Height="23" ToolTip="下一页" CommandArgument="next" ImageUrl="../../../Images/next.gif" BorderWidth="0"></asp:imagebutton></td>
  189. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_last" Width="23" Runat="server" Height="23" ToolTip="最后一页" CommandArgument="last" ImageUrl="../../../Images/end.gif" BorderWidth="0"></asp:imagebutton></td>
  190. -->
  191. <td align=center width=""><a runat=server id="backlink">返回</a></td>
  192. </tr>
  193. <tr>
  194. <td align=left width="" class=gbtext>图例说明<img src="../../../images/sysbulletin.gif">系统公告<img src="../../../images/bulletin.gif">本版公告<img src="../../../images/hotfolder.gif">热门贴(点击多于<%=hotitemhittimes%>)<img src="../../../images/folder.gif">普通贴</td>
  195. </tr>
  196. </table>
  197. </form>
  198. </body>
  199. </HTML>