how to program the <div> element?

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???
 
E

Edge

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top