在過去,我曾在使用自定義模板字段列表視圖(.NET 2.0),但我想在這裏實現的是以下ASP.NET(C#) - 的ListView
我我現在工作的.NET 4.6
所以基本上一個列表,顯示像上面和項目鼠標懸停幾個選項顯示爲顯示在下面的屏幕截圖
我也有觸發那些選擇做不同的事情 -
我怎樣才能做到這在asp.net,我可以請有一些代碼引用。
Cheers
P.S. 這就是我如何創建列表項目模板(如需要)
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
<AlternatingItemTemplate>
<table >
<tr>
<td ><asp:Image ID="image1" ImageUrl='<%# Bind("url") %>' runat="server" Width="98px" /> </td>
<td><h2><asp:Label ID="_label" runat="server" Text ='<%# Bind("title") %>'></asp:Label></h2><asp:Label ID="Label1" runat="server" Text ='<%# Bind("description") %>'></asp:Label></td>
</tr>
</table>
</AlternatingItemTemplate>
<EmptyDataTemplate>
No data was returned.
</EmptyDataTemplate>
<ItemSeparatorTemplate>
<br />
</ItemSeparatorTemplate>
<ItemTemplate>
<table >
<tr>
<td ><asp:Image ID="image1" ImageUrl='<%# Bind("url") %>' runat="server" Width="98px" /> </td>
<td><h2><asp:Label ID="_label" runat="server" Text ='<%# Bind("title") %>'></asp:Label></h2><asp:Label ID="Label1" runat="server" Text ='<%# Bind("description") %>'></asp:Label></td>
</tr>
</table>
</ItemTemplate>
<LayoutTemplate>
<ul id="itemPlaceholderContainer" runat="server" style="">
<li runat="server" id="itemPlaceholder" />
</ul>
<div style="">
</div>
</LayoutTemplate>
</asp:ListView>
我可以添加任何HTML格式來此模板E的粗糙的例子,GI可以添加ASP:按鈕等,但我不知道如何觸發這些人執行某些任務。
什麼是可能的?你是要求一個代碼,還是可以將代碼遷移到4.6?請澄清你想要的東西。 – yesIcan
嗨,感謝您的回覆,我要求代碼'更新後的帖子 – aliusman
@aliusman它的代碼不要求網站:),你必須發佈你自己的代碼,然後詢問*不工作*或其他東西。 – AsifAli72090