How can I add a css class to an updatepanel in the c# code behind file of asp.net
An update panel can render as a div or span (depending on mode). Easiest way to achieve what you want is to wrap the UpdatePanel in a standard Panel:
The you can just do this in codebehind:
Panel1.CssClass = "myCssClass";
You could also use a div, like LFSR Consulting said, and add runat="server"
and then change the class attribute. But Panel is a bit easier to work with (a Panel just renders as a div).