c# - remove css class in code behind -


i have control

<asp:label id="lblname" runat="server" text="my name" cssclass="required regular" /> 

i want remove required class code behind, how can that?

you can replace "required" empty string:

lblname.cssclass = lblname.cssclass.replace("required", ""); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -