Link to home
Start Free TrialLog in
Avatar of jbaisden
jbaisden

asked on

Setting the class attribute of an System.Web.UI.HtmlControls.HtmlTableCell ???????? ASP VB NET

This is probably really easy, but it's bothering the heck out of me. I am dynamically adding cells to rows and rows to a table, all of which are the System.Web.UI.HtmlControls type. I have the following excerpt:  

                tableCell = New System.Web.UI.HtmlControls.HtmlTableCell
                tableCell.Attributes.CssStyle.Add("class", "ModuleSubHead")
                tableRow.Cells.Add(tableCell)

...which doesn't seem to be setting the class attribute of the <TD> tag. Instead the above code adds the following:
<TD style="Class: ModuleSubHead" >, which doesn't work.

What I want to end up with is the following:

<TD class="ModuleSubHead" > </td>.

It doesn't seem like this should be that difficult. Can someone please help me out here>
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

tableCell.Attributes..Add("class", "ModuleSubHead")

-Nauman.
ASKER CERTIFIED SOLUTION
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbaisden
jbaisden

ASKER

Duh! I thought I had tried that. No matter. Thanks!!!