asp:label mapping question

G

gouqizi.lvcha

I am using asp:label control run at server side, and I can see it is
mapped to a <span> element in the final html source. Can I change this
mapping, for example, change it to map to <div> element.
 
T

tomk148

nah. you could inherit and override the render, but thats more
trouble than its worth.

you can give the span's style "display: block" to make it draw like a
behave like a div insofar as css is concerned however.
 
A

Aidy

Make it a literal instead;

string myText = "hello";
myLiteral.Text = string.format ("<div>{0}</div>", myText);

Or see if a Panel will do what you want as in 2.0 there are rendered as
divs.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top