I am installing a css class in code located in ASP.NET
I could do:
txtBox.Attributes.Add("class", "myClass");
or
txtBox.Attributes["class"] = "myClass";
- What are the differences?
- Are there any situations in which you need to use another?
- What happens in case 1 if the class is already assigned on the aspx page? Does he rewrite it?
source share