Hi guys
I'm generating a collection of labels so it reports each status message in its own <span>...</span> line, like this:
<%@ Page Language="VB" Debug="true" %>
<Script Runat="Server">
Sub Page_Load(o as Object, e as EventArgs) Call DoThis() Call DoThat() End Sub
Sub DoThis() Dim lblStatus As New Label() lblStatus.CssClass = "black" lblStatus.Text = "This should be black.<br />" plcHolder.Controls.Add(lblStatus) End Sub
Sub DoThat() Dim lblStatus As New Label() lblStatus.CssClass = "red" lblStatus.Text = "This should be red.<br />" plcHolder.Controls.Add(lblStatus) End Sub
</Script>
<html> <head> <title>aTitle</title> <style> body { font-family: Verdana; } .black { color: black; } .red { color: red; } </style> </head> <body>
<asp:PlaceHolder ID="plcHolder" runat="server" />
</body> </html> |
However, the response gives me 2 spans in the same line:
<span class="black">This should be black.<br /></span><span class="red">This should be red.<br /></span>
|
I want the spans in seperate lines so I can read what is being generated, I would like it like this:
<span class="black">This should be black.<br /></span>
<span class="red">This should be red.<br /></span> |
I manage to add a vbCrLf like this [ lblStatus.Text = "This should be red.<br />" & vbCrLf ] to both lines but the closer I get is this:
<span class="black">This should be black.<br /> </span><span class="red">This should be red.<br /> </span> |
Now, how do I get this <spans> to output the way I want?
By the way, whats the control that will output <divs>?
Thanks guys.