Since DIV is a simple html control, you need to make it server control. Then you can access all the properties of it.
You need to do the following:
<div id="dvTest" runat="server" class="something">
string style = dv.Attributes["class"].ToString();