Click to See Complete Forum and Search --> : <span>=Label / <div>=???


tomhartland
05-14-2004, 03:55 AM
This sounds like it should be really simple, but I'm having one of those days (and it's only 8:50am - not good).

Is there a web control to produce a <div> tag? Using the WebControls.Label class produces a <span> tag, but I can find no control which produces a <div>.

(I'm resorting to using a HtmlControls.HtmlGenericControl at the moment, but would prefer to use a built in class.)

Am I being totally thick? (Okay, thicker than normal...)
Cheers,
Tom

PeOfEo
05-14-2004, 06:15 PM
No, the is not one that outputs a div that I know of. The reason label outputs span is because label is intended for a line of text and span is intended for text. When the server controls output a block elements (place holder pannel, etc) it is always a table. If you want a div to runat the server so you can make it visible and invisible, and modify its content, do what I do
<div runat="server">content</div>
You can put asp.net elements in there or do response.write's for the content, so on and so fourth.

tomhartland
05-15-2004, 02:12 PM
Ah, fair enough - I didn't think there was one, but I thought I'd check.
Thanks for the advice :)

PeOfEo
05-15-2004, 02:13 PM
np