Hello Shapper,
use HtmlGenericControl like this
Control control = this.FindControl("body");
HtmlControl divControl = new HtmlGenericControl("div");
divControl.Attributes.Add("id","myid");
divControl.Attributes.Add("class","myclass");
control.Controls.Add(divControl);
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:
http://spaces.live.com/laflour
Team blog:
http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
SHello,
S>
SI want to add a div tag with a few properties (class, id, ...) to a
Spage. I would like to build the following block:
S>
S<div id="myid" class="myclass">
S>
S<Asp:TextBox...
S>
S</div>
S>
SI don't want to add the div using Asp:Panel.
S>
SI know I can use literal. But is there another way to define the div
Sand its properties before adding it to the page without using a
Sstring?
S>
SWhat should be the best way to do this?
S>
SThanks,
S>
SMiguel
S>