I'm trying to dynamically add results to this display and I simply want to put a break tag after a label to start putting information on the next line. For some reason, Using a literal isn't working for me. Is there a better way to do this or should I just use tables?
Dim break As LiteralControl
break = New LiteralControl("<br />")
divListenerInfo.Controls.Add(break)
That's part of the code that I'm attempting to use.
It's not working as in the line break isn't showing up on the webpage. It's compiling fine and there is nothing wrong with the code. It just doesn't show up in the html for some odd reason.
The proper control to use is the HtmlGenericControl
.
Dim br As New HtmlGenericControl("br")
You can use the HtmlGenericControl
to render any HTML element you wish, simply pass the element's tag name as a single argument to the constructor.
Why not just use another label, or append the <br>
to the previous label.txt?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With