I am setting the css class in the code behind in ASP.NET
I could either do:
txtBox.Attributes.Add("class", "myClass");
or
txtBox.Attributes["class"] = "myClass";
- What are the differences?
- Are there any situations in which one should be used over the other?
- What happens in case 1 if the class is assigned in the aspx page already? Does it overwrite it?