forum_attchemntgrid.aspx
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:3k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. <%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
  2. <%@ Page language="c#" Inherits="Discuz.Web.Admin.attchemntgrid" Codebehind="forum_attchemntgrid.aspx.cs" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html>
  5. <head>
  6. <title>附件批量删除</title>
  7. <link href="../styles/datagrid.css" type="text/css" rel="stylesheet" />
  8. <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet" />  
  9. <script type="text/javascript" src="../js/common.js"></script>
  10. <script type="text/javascript">
  11. function Check(form)
  12. {
  13. CheckAll(form);
  14. checkedEnabledButton(form,'aid','DeleteAttachment');
  15. }
  16. </script>
  17. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  18. </head>
  19. <body>
  20. <form id="Form1" method="post" runat="server">
  21. <cc1:datagrid id="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid" PageSize="20">
  22. <Columns>
  23. <asp:TemplateColumn HeaderText="<input title='选中/取' onclick='Check(this.form)' type='checkbox' name='chkall' id='chkall' />">
  24. <HeaderStyle Width="20px" />
  25. <ItemTemplate>
  26. <input id="aid" onclick="checkedEnabledButton(this.form,'aid','DeleteAttachment')" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.aid").ToString() %>" name="aid" />
  27. </ItemTemplate>
  28. </asp:TemplateColumn>
  29. <asp:BoundColumn DataField="aid" SortExpression="aid" HeaderText="附件id" Visible="false" ></asp:BoundColumn>
  30. <asp:BoundColumn DataField="attachment" SortExpression="attachment" HeaderText="附件原名"></asp:BoundColumn>
  31. <asp:TemplateColumn HeaderText="文件名">
  32. <ItemTemplate>
  33. <a href="<%# DataBinder.Eval(Container, "DataItem.filename").ToString().Trim().ToLower().IndexOf("http://") == -1 ? "../../upload/" + DataBinder.Eval(Container, "DataItem.filename").ToString().Trim().Replace("\","/") : DataBinder.Eval(Container, "DataItem.filename").ToString().Trim() %>" target="_blank"><%# DataBinder.Eval(Container, "DataItem.filename").ToString().Trim()%></a>
  34. </ItemTemplate>
  35. </asp:TemplateColumn>
  36. <asp:BoundColumn DataField="poster" SortExpression="poster" HeaderText="作者" ></asp:BoundColumn>
  37. <asp:BoundColumn DataField="topictitle" SortExpression="topictitle" HeaderText="所在主题"></asp:BoundColumn>
  38. <asp:BoundColumn DataField="filesize" SortExpression="filesize" HeaderText="尺寸[字节]"></asp:BoundColumn>
  39. <asp:BoundColumn DataField="downloads" SortExpression="downloads" HeaderText="下载次数"></asp:BoundColumn>
  40. </Columns>
  41. </cc1:datagrid>
  42. <p style="text-align:right;">
  43. <cc1:Button id="DeleteAttachment" runat="server" Text=" 删除选中的附件 " ButtonImgUrl="../images/del.gif" Enabled="false" OnClientClick="if(!confirm('你确认要删除所选附件吗?n删除后将不能恢复!')) return false;"></cc1:Button>&nbsp;&nbsp;
  44. <cc1:Button id="DeleteAll" runat="server" Text=" 直接全部删除 " ButtonImgUrl="../images/del.gif" OnClientClick="if(!confirm('你确认要删除所有附件吗?n删除后将不能恢复!')) return false;"></cc1:Button>
  45. </p>
  46. </form>
  47. <%=footer%>
  48. </body>
  49. </html>