Clearing styles

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

In 3.5 you can add styles like so:

MessageLabel.Style.Add("color", "Red");
MessageLabel.Style.Add("font-weight", "Bold");

But there is a Clear method as well - but I called it like so:

MessageLabel.Style.Clear();

But it still displayed Red and Bold.

Doesn't Clear() clear the styles?

Thanks,

Tom
 
In 3.5 you can add styles like so:

MessageLabel.Style.Add("color", "Red");
MessageLabel.Style.Add("font-weight", "Bold");

But there is a Clear method as well - but I called it like so:

MessageLabel.Style.Clear();

But it still displayed Red and Bold.

Doesn't Clear() clear the styles?

By the context, it seems that you're referring to ASP.NET, and
WebControl.Style. If so, then clearing should work, but it's hard to
say much without seeing the actual code that exhibits the problem.
Maybe you're clearing it too early or too late in the page lifecycle,
maybe there's something else.
 
Thad,

I have the same problem with your message like Pete and Pavel.

However, with styles it is always that as a style on a lower part is
cleared, the style from a higher part becomes active.

Cor
 
Back
Top