On May 4, 4:54*pm, "tshad" <t...@pdsa.com> wrote:
> 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.
|