It\'s easy to set CssClass in the code-behind, but this runs the risk of overwriting existing classes.
I need to set certain elements to ReadOnly
Related... if you just want to toggle a Class based upon a condition...
bool disable = true; // this will vary (true/false) based on UI state
string newClass = disable ? "BtnGray" : "BtnPink";
string currentClass = disable ? "BtnPink" : "BtnGray";
myButton.CssClass = myButton.CssClass.Replace( currentClass, newClass );