<asp:DataList ID="fileList" runat="server" RepeatColumns="1" RepeatDirection="Horizontal"
CssClass="body" DataKeyField="ContentID" OnItemCommand="fileList_ItemCommand">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" style="width: 760px">
  <tr>
    <td style="width: 760px; text-align: center">
      <a href='<%# SetFileUrl(DataBinder.Eval(Container.DataItem, "ContentName"))%>'>
        <%# SetFileName(DataBinder.Eval(Container.DataItem, "ContentName"))%></a>
    </td>
  </tr>
  <tr>
    <td style="width: 760px; text-align: center">
      <iframe />
    </td>
  </tr>
</table>
</ItemTemplate>
</asp:DataList>

 

protected void fileList_ItemCommand(object source, DataListCommandEventArgs e)
{
  int menuId;
  string contentName = string.Empty;
  bool result = true;
  if (e.CommandName == "del")
  {
    int id = Int32.Parse(fileList.DataKeys[e.Item.ItemIndex].ToString());
    result = bllConent.DeleteItem(id, out menuId, out contentName);

    if (result)
    {
      result = AndroidKit.Common.ComHelper.DeleteFile(contentName);
      BindData(menuId);
      Response.Write("<script>alert(\"删除成功\")</script>");
    }
  }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
猜你喜欢
  • 2021-09-25
  • 2022-12-23
  • 2022-01-01
  • 2021-06-12
  • 2022-01-11
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案