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?
Removing class from a div in c#
626504-Feb-2014
Pravesh Singh
04-Feb-2014If 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", ""));