asp:label mapping question

  • Thread starter Thread starter gouqizi.lvcha
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top