I have ordinary div like this:
<div id="myCoolElement"
runat="server"></div>
I want use the construction to set CssClass for
myCoolElement like this:
myCoolElement.CssClass("mycoolstyle");
But CssClass property is supported only for WebControls.
How I can set CssClass for my element without creating
WebControl?
Try this.
myCoolElement.Attributes.Add("class", "mycoolstyle");
You can do like this
myCoolElement.Attributes["class"] = "mycoolstyle";