mmilan
mmilan

Reputation: 1778

Clear CSS added by TagBuilder AddCssClass MVC4

I have a tagbuilder , I added css to the tag like this:

td.AddCssClass("Center");

now I need to clear all the css that has been applied to the tagbuilder.

what is the best way of clearing it?

Upvotes: 2

Views: 599

Answers (1)

hutchonoid
hutchonoid

Reputation: 33306

You can do it like this:

tb.Attributes["class"] = string.Empty

tb is your TagBuilder.

Upvotes: 2

Related Questions