How can I add a css class to an updatepanel in the c# code behind file of asp.net
As you've seen the update panel doesn't have a css class property. So since it can't be done directly you need a work around; there are two (Grabbed from UpdatePanel and CSS) that can get the behavior you desire.
One is to surround the update panel with a div:
The other is to apply a css selector based on the update panel's id:
Yet another way not mentioned in the article is surround the panel in a div and style the update panel based on it rendering as a div: