I am pulling data from SQL 2000 Text fields and displaying in ASP.NET 2.0. The thing is that the data has HTML formatting tags embedded in the data because it is displayed as a web page in another app. I am using a formview to show this data. If I display it in the asp label control - the default control for the formview - the HTML is read and the data displayed correctly with the HTML formatting. However, the text can be rather long and it really needs scroll bars to display it properly. But, if I use a multiline text control to hold the text, the HTML tags are displayed as part of the text, and are not formatted. i.e. <html><body><font>&# 060;b>THE BODY OF THE TEXT <BR>Is there a way or a different control that could be used to 1. Provide Scrolling for this text 2.Display the text as HTML. <BR><BR>Thanks in advance, <BR><BR>Dave
Sure...Put the label in a div (though with that much text, it would really probably be more technically correct to use a literal instead of a label.) <BR><BR>Use CSS to define the hight and the width that you want the div to be, and set its scrollable property (again in CSS) to true.
The label is not the problem. In the database the text is stored with HTML tags ( <html><body>Text,etc., etc </body></html> ) When I display this in a label in a formview template the HTML is processed and the text displayed with whatever formatting the HTML represents. But that is shown in a very long column with no scroll bars. If I change the control in the formview template to a multiline text box, I get the scroll bars but the text is displayed with all the HTML tags shown as plain text. I need to have the text in the textbox process the tags and not show them.<BR><BR><BR>This includes scroll bars but displays HTML as plain text<BR><asp:TextBox ID="TextBox1" runat="server" Font-Names="Verdana" Font-Size="XX-Small" Height="180px" Text=<BR>'<%# Bind("BG_DEV_COMMENTS">'<BR>TextMode="Mu ltiLine"Width="352px"></asp:TextBox><BR><BR>This uses the HTML formatting but has no scroll bars.<BR><asp:Label ID="BG_DEV_COMMENTSLabel" runat="server" Text='<%# Bind("BG_DEV_COMMENTS") %>' Font-Names="Verdana" Font-Size="X-Small"></asp:Label
Bookmarks