Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change CSS class of HtmlGenericControl

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi, there doesn't appear to be a CssClass attribute of HtmlGenericControl, even though there is a Style one. Is it possible to programmatically change the CSS class of HtmlGenericControl? If not, why not?!

Tom
emo_big_smile.gif
 
You can use Attributes.Add and add a "class" property e.g.
Code:
myHTMLControl.Attributes.Add("class","myClass")



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi, thanks for this, but I think that was one of the things I tried. I think it had a problem because a class attribute already existed for that element (since I'm trying to change it rather than simply add it). However, trying myControl.Attributes.Remove("myclass") first didn't make any difference. Still, I'll try this again in case I was doing something wrong the first time...

Tom
emo_big_smile.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top