ASP.NET Web Controls support the addition of arbitrary user-defined via the Attributes property. This collection (of type System.Web.UI.AttributeCollection) is a handy place to programmatically add client-side event handlers to a control's rendered HTML.
I noticed today that the Add() method of AttributeCollection has slightly different semantics than the Add() method defined in other framework collection types. Most other name-value collections will throw an exception if you try to use Add() to insert a key that already exists. AttributeCollection.Add() will happily overwrite exsisting values. As such, these two calls are semantically equivalent:
control.Attributes.Add("foo", "bar");
control.Attributes["foo"] = "bar";
Whether this is a Good Thing or a Bad Thing is highly context-dependent. Regardless, it's something to watch out for.
