how to program the <div> element?

  • Thread starter Thread starter Daves
  • Start date Start date
D

Daves

I find this odd;

to create a DIV (html) element I use the HTMLGeneric control;
<div ID="myDiv" runat=server ...

This has no .Text property such as
myDiv.Text = "testing";

So I am forced to use the Label control instead but that one results in a
<span> element for which many style attributes cannot be used, e.g.
text-align


So what to do???
 
Daves said:
I find this odd;

to create a DIV (html) element I use the HTMLGeneric control;
<div ID="myDiv" runat=server ...

This has no .Text property such as
myDiv.Text = "testing";

So I am forced to use the Label control instead but that one results
in a <span> element for which many style attributes cannot be used,
e.g. text-align


So what to do???

Use myDiv.InnerHtml or myDiv.InnerText.
 
Back
Top