I'm listing some controls at my web page dynamically, either I'm adding newline with Label's.
Label newLine = new Label();newLine.Text = "<br/>"; myPanel.Controls.Add(newLine);
How can I do it in a different way?
I'm listing some controls at my web page dynamically, either I'm adding newline with Label's.
Label newLine = new Label();newLine.Text = "<br/>"; myPanel.Controls.Add(newLine);
How can I do it in a different way?
I would suggest that you don't use
at all. Use CSS to display your controls. display:block on your elements will work just fine. Less messy!
My problem: Add a text to a panel indicating a date range. The text should be placed below an hyperlink.
The CSS solution:
A. Create the CSS class (place it on your page or into a CSS file)
B. Create controls and set the proper CSS class (.CssClass property)
The final output looks like the this:
Sources:
CSS display Property (w3schools)
Example (w3schools)