I add a css class to my li tag like following:
liComPapers.Attributes.Add("class", "NoDisplay");
Is there any way to remove this specific class (NoDisplay) from that li tag somewhere else in my code?
I have tried the following code but it is not working.
liComPapers.Attributes["class"] = "";
Thanks
I’ve just made a sample to test your code, and found that the following part will do exactly what you want:
Tested and Working:
if (for some reason) the above code didn’t work, I would recommend another approach, which is similar to the previous, with another way to replace the class value