我試圖在對象數據源的列表視圖中彈出圖像。asp.net listview彈出圖像
我希望當我們點擊圖像的行,因爲這個圖像彈出顯示。
在我的代碼它總是在彈出wathever我點擊圖像的第一圖像(因爲彈出的合輯「自身建設」,並沒有在運行。
<asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource2" OnItemDataBound="ListView1_ItemDataBound" OnItemCommand="ListView1_ItemCommand" DataKeyNames="HotelID">
<EditItemTemplate>
<li style="">HotelID:
<asp:TextBox ID="HotelIDTextBox" runat="server" Width="200px" Text='<%# Bind("HotelID") %>' />
<br />
HotelName:
<asp:TextBox ID="HotelNameTextBox" runat="server" Text='<%# Bind("HotelName") %>' />
<br />
Country:
<asp:TextBox ID="CountryTextBox" runat="server" Text='<%# Bind("Country") %>' />
<br />
Town:
<asp:TextBox ID="TownTextBox" runat="server" Text='<%# Bind("Town") %>' />
<br />
Image:
<asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>' />
<br />
City:
<asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
<br />
Country1:
<asp:TextBox ID="Country1TextBox" runat="server" Text='<%# Bind("Country1") %>' />
<br />
Rooms:
<asp:TextBox ID="RoomsTextBox" runat="server" Text='<%# Bind("Rooms") %>' />
<br />
<asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
</li>
</EditItemTemplate>
<EmptyDataTemplate>
No data was returned.
</EmptyDataTemplate>
<InsertItemTemplate>
<li style="">HotelID:
<asp:TextBox ID="HotelIDTextBox" runat="server" Text='<%# Bind("HotelID") %>' />
<br />
HotelName:
<asp:TextBox ID="HotelNameTextBox" runat="server" Text='<%# Bind("HotelName") %>' />
<br />
Country:
<asp:TextBox ID="CountryTextBox" runat="server" Text='<%# Bind("Country") %>' />
<br />
Town:
<asp:TextBox ID="TownTextBox" runat="server" Text='<%# Bind("Town") %>' />
<br />
Image:
<asp:TextBox ID="ImageTextBox" runat="server" Text='<%# Bind("Image") %>' />
<br />
City:
<asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
<br />
Country1:
<asp:TextBox ID="Country1TextBox" runat="server" Text='<%# Bind("Country1") %>' />
<br />
Rooms:
<asp:TextBox ID="RoomsTextBox" runat="server" Text='<%# Bind("Rooms") %>' />
<br />
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
</li>
</InsertItemTemplate>
<ItemSeparatorTemplate>
<br />
</ItemSeparatorTemplate>
<ItemTemplate>
<li style="">
<table style="width: 100%;">
<tr style="width: auto; background-color: white;">
<td align="center">
<div id="pageone" data-role="main" class="ui-content">
<a href="#myPopup" data-rel="popup" data-position-to="window">
<img src='<%# Eval("Image")%>' alt="Skaret View" style="height: 116px; width: 311px"></a>
<div data-role="popup" id="myPopup" data-transition="flip" data-overlay-theme="b">
<p>This is my picture!</p>
<a href="#pageone" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img src='<%# Eval("Image")%>' style="width: 800px; height: 400px;" alt="Skaret View">
</div>
</div>
<td>
<asp:Label ID="HotelNameLabel" runat="server" Text='<%# Eval("HotelName")%>' Font-Underline="true" />
<br />
<asp:Label ID="TownLabel" runat="server" Text='<%# Eval("Town")%>' />
,
<asp:Label ID="CountryLabel" runat="server" Text='<%# Eval("Country")%>' />
<br />
<asp:Label ID="HotelIDLabel" runat="server" Text='<%# Eval("HotelID")%>' Visible="false" />
</td>
<br />
<br />
<td align="right">
<asp:Button ID="Button1" runat="server" CssClass="styled-button-2" Text="Book Now" PostBackUrl='<%#"~/BookHotel.aspx?HotelID=" + Eval("HotelID")%>' />
</td>
</tr>
</table>
</li>
</ItemTemplate>
<LayoutTemplate>
<ul id="itemPlaceholderContainer" runat="server" style="list-style: none">
<li runat="server" id="itemPlaceholder" />
</ul>
<div style="">
</div>
</LayoutTemplate>
<SelectedItemTemplate>
<li style="">HotelID:
<asp:Label ID="HotelIDLabel" runat="server" Text='<%# Eval("HotelID")%>' />
<br />
HotelName:
<asp:Label ID="HotelNameLabel" runat="server" Text='<%# Eval("HotelName")%>' />
<br />
Country:
<asp:Label ID="CountryLabel" runat="server" Text='<%# Eval("Country")%>' />
<br />
Town:
<asp:Label ID="TownLabel" runat="server" Text='<%# Eval("Town")%>' />
<br />
Image:
<asp:Label ID="ImageLabel" runat="server" Text='<%# Eval("Image")%>' />
<br />
City:
<asp:Label ID="CityLabel" runat="server" Text='<%# Eval("City")%>' />
<br />
Country1:
<asp:Label ID="Country1Label" runat="server" Text='<%# Eval("Country1")%>' />
<br />
Rooms:
<asp:Label ID="RoomsLabel" runat="server" Text='<%# Eval("Rooms") %>' />
<br />
</li>
</SelectedItemTemplate>
</asp:ListView>
感謝 (如果有一個解決方案做圖像按鈕的onclick出現IT方面也很好的彈出窗口。)
非常感謝