My site has descriptions of the products we sell and I am currently trying to get those descriptions to pop up inside a modal popupextender. I can get them to popup with a textbox where I have enabled="false" so that it can't be edited, but it shows all the tags along with the text such as the <p>
, <li>
, etc. Is there a different control I can use inside of my modal that will show my text better?
<!-- 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>
Here's an example of the <%# 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>
If the text wont be editable, why don't you use a asp:label instead?
Does the MarketingData field include html tags? Please provide an example of the value for MarketingData.
Edit: If you know wich tags can be present on your text, you can simply create a property on the class that hold the propoerty called MarketingData, like this:
public string EditedMarketingData
{
get {return MarketingData.Replace("<p>","").Replace("</p>","").Replace("<li>","");}
}
And then change the binding in your text box as:
Text='<%# Eval("EditedMarketingData") %>'
The replacing is kind of ugly, hope you can get that to look better ;)