【发布时间】:2014-02-14 03:27:27
【问题描述】:
我有一个 Listview 显示我的文件系统中一个文件夹的多个文件实体。我想让该 ListView 的多个条目可选择,就像在 Dropbox 中选择文件 fpr 移动、删除等一样。
这是我目前的 ListView:
<asp:ListView ID="fileListView" runat="server" OnItemCommand="fileListView_OnItemCommand">
<ItemTemplate>
<asp:LinkButton id="downloadFile" runat="server" cssclass="fileListTitle" CommandName="downloadFile" CommandArgument='<%# Session["filePath"].ToString() + Eval("fileName").ToString() %>'><img src="img/download.png" class="downloadButton" alt="herunterladen" /><%# Eval("fileName")%></asp:LinkButton>
<%-- <a class="fileListTitle" href="<%# Session["filePath"].ToString() + Eval("fileName").ToString() %>" target="_blank" >
<img src="img/download.png" class="downloadButton" alt="herunterladen" /><%# Eval("fileName")%></a>--%>
<asp:Label CssClass="fileListSize" ID="fileSize" runat="server"><%# Eval("size") %></asp:Label>
<asp:Label CssClass="fileListDate" ID="creationDate" runat="server"><%# Eval("cDate") %></asp:Label>
<div class="fileListMenu">
<asp:LinkButton runat="server" cssClass="fileEditButton" ToolTip="Umbennen" CommandName="renameFile" CommandArgument='<%# Eval("fileName") %>'></asp:LinkButton>
<asp:LinkButton runat="server" cssClass="fileDeleteButton" ToolTip="Löschen" CommandName="deleteFile" CommandArgument='<%# Eval("fileName") %>'></asp:LinkButton>
</div>
<div class="clear">
</div>
<br />
</ItemTemplate>
</asp:ListView>
我想要与他们在 Dropbox 中使用的功能相同的功能,我刚刚选择了一些条目:
【问题讨论】:
-
DropBox 使用了 lot 的 JavaScript。我不希望能够使用本机 WebForms 服务器端控件严格模仿其功能。
-
在您的 ItemTemplate 中添加一个复选框...
标签: c# asp.net listview select dropbox