User-14247900 posted
hi,
when i try to render the control like that:
output.Write("<br/>");
output.RenderBeginTag(HtmlTextWriterTag.Font);
output.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "150px");
output.AddStyleAttribute(HtmlTextWriterStyle.Color, "green");
output.RenderBeginTag(HtmlTextWriterTag.B);
output.Write(Text);
output.RenderEndTag();
output.RenderEndTag();
i get what i was expected to see.
But, when i take out the <b/> element as in:
output.Write("<br/>");
output.RenderBeginTag(HtmlTextWriterTag.Font);
output.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "150px");
output.AddStyleAttribute(HtmlTextWriterStyle.Color, "green");
//output.RenderBeginTag(HtmlTextWriterTag.B);
output.Write(Text);
output.RenderEndTag();
//output.RenderEndTag();
the result rendered page take the style and wrap it the hidden field instead of the control (as it does when the <b/> is available.
I know it's a simple one.
But why is this difference in behavior? what if all i want is the same result but with no bold text?