我的網站對我們銷售的產品有描述,我目前正試圖讓這些描述在模態popupextender中彈出。我可以讓他們彈出一個文本框,我已啓用=「false」,以便它不能被編輯,但它會顯示所有標籤以及文本,例如<p>
,<li>
等。是否有其他控件我可以在我的模式裏面使用,這會更好地顯示我的文字?使ModalPopUp正確顯示填充文本框的問題
<!-- Descriptions -->
<asp:TabPanel ID="tab2" runat="server" HeaderText="Descriptions">
<HeaderTemplate>Descriptions</HeaderTemplate>
<ContentTemplate>
<ul class="info">
<asp:ListView ID="lvDescriptions" runat="server" DataSourceID="dsMarketingDescriptions" DataKeyNames="MarketingID">
<ItemTemplate>
<li>
<asp:LinkButton ID="ViewDescriptionButton" runat="server"><%#Eval("MarketingTitle")%></asp:LinkButton>
<asp:ImageButton ID="DeleteDescriptionButton" runat="server" Style="float:right;" AlternateText="" ImageUrl="../../images/delete.png" CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this description?')" />
<asp:Panel ID="ViewDescriptionPanel" runat="server">
<asp:ImageButton ID="CancelDescriptionButton" runat="server" ImageUrl="../../images/exit.png" AlternateText="" Style="float:right;"/>
<asp:TextBox ID="Description" runat="server" width="100px" height="100px" Enabled="false" TextMode="MultiLine" Text='<%# Eval("MarketingData") %>'/>
</asp:Panel>
<asp:ModalPopupExtender ID="ViewDescriptionModal" runat="server" BackgroundCssClass="modalBackground" DropShadow="false" DynamicServicePath="" Enabled="true" PopupControlID="ViewDescriptionPanel" TargetControlID="ViewDescriptionButton" CancelControlID="CancelDescriptionButton"></asp:ModalPopupExtender>
</li>
</ItemTemplate>
</asp:ListView>
</ul>
</ContentTemplate>
</asp:TabPanel>
這裏的<%#的eval( 「MarketingData」)%>的例子: <p>If you are currently trading options on futures or are interested in exploring them further, check out this newly updated trading guide, featuring 25 commonly used options strategies, including butterflies, straddles, strangles, backspreads and conversions. Each strategy includes an illustration demonstrating the effect of time decay on the total option premium involved in the position.</p><p>Options on futures rank among the most versatile risk management tools, and are offered on most CME Group products. Whether you trade options for purposes of hedging or speculating, you can limit your risk to the amount you paid up-front for the option while maintaining your exposure to beneficial price movements.</p>
是的,他們包括HTML標籤。我不知道爲什麼,但這是他們被放入數據庫的方式,這可能使我們的其他網站更容易。檢查上面的修改。 – jlg
您擁有的其他選項是編輯綁定事件上的文本,但我更願意使用特定的目的屬性,因爲您可能需要在應用程序的其他位置使用它。 – daniloquio
我繼續,並採取了第一個建議,你必須提供,這是使用一個標籤。我在CSS中添加了一些東西,它的工作方式與我以前想要的一樣。標籤比試圖讓文本框不可編輯更容易。感謝您的建議! – jlg