removing class from a div in c#

c#, css

Solution

If you are wanting to read the class name, you will need to use the code:

string className = Test.Attributes["class"].ToString();

If you are wanting to replace a specific class you will need to use the code:

Test.Attributes.Add("class", Test.Attributes["class"].ToString().Replace("spacerDiv", ""));

Problem

I tried using the server-side `.CssClass`, but this isn't available for me to use. My div has `runat="server"` so I can access it, but I just cannot see `.CssClass` in the drop-down when i hit ".". Does anyone know how to get past this or any other solution that might work? Ok, my bad. I just found out that this does not work for HTML controls, only for asp controls

Original source