You just need to use styleinstead class:
html1.Attributes.Add("style", "display:none");
You can also consider creating a CSS style, for example:
.hidden
{
display:none;
}
And then apply it through the "class":
html1.Attributes.Add("class", "hidden");
source
share