我試圖讓一個modalpopupextender從列表視圖顯示在一個標籤面板內。如果這是可能的,有人可以幫助我嗎?這是我的圖像列表視圖,從這裏我只想彈出圖像 - 像使用lightbox或fancybox。我真的很想使用ajax模式,因爲這個頁面的其他部分正在使用它,我希望頁面模式一致。ASP.net列表視圖AJAX ModalPopupExtender
<!-- Images -->
<asp:TabPanel id="tab5" runat="server" HeaderText="Images">
<ContentTemplate>
<ul class="info">
<asp:ListView ID="lvImages" runat="server" DataSourceID="dsMarketingImages">
<ItemTemplate>
<li title='<%# eval("MarketingData") %>'>
<a target="_blank" href="<%# eval("MarketingData") %>"><%#Eval("MarketingTitle")%></a>
</li>
</ItemTemplate>
</asp:ListView>
</ul>
</ContentTemplate>
</asp:TabPanel>
我想這樣做,但得到的錯誤:服務器標記不正確。如何顯示模態內的圖像?我很難過這裏。幫助將不勝感激!
<asp:ListView ID="lvImages" runat="server" DataSourceID="dsMarketingImages" DataKeyNames="MarketingID">
<ItemTemplate>
<li>
<asp:LinkButton ID="ViewImagesButton" runat="server"><%#Eval("MarketingTitle")%></asp:LinkButton><asp:ImageButton ID="ImageButton1" runat="server" Style="float:right;" AlternateText="" ImageUrl="../../images/delete.png" CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this image?')" />
<asp:Panel ID="ViewImagesPanel" runat="server">
<asp:Image ID="Image1" runat="server" href="<%# Eval("MarketingData") %>"/>
</asp:Panel>
<asp:ModalPopupExtender ID="ViewImagesModal" runat="server" BackgroundCssClass="modalBackground" DropShadow="true" DynamicServicePath="" Enabled="true" PopupControlID="ViewImagesPanel" TargetControlID="ViewImagesButton"></asp:ModalPopupExtender>
</li>
</ItemTemplate>
</asp:ListView>