Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
Hi

I have a page where i am creating table row and table cell dynamically and adding a control to in it.

It is as below

HtmlTableRow tr = new HtmlTableRow();
HtmlTableCell td = new HtmlTableCell();


tr.ID = "tr" + i.ToString();
tblPerSetngs.Controls.Add(tr);
CheckBox chk = new CheckBox();
chk.ID = "chk" + i.ToString();
chk.Text = dtTechSkills.Rows[i]["SkillName"].ToString();


td.Controls.Add(chk);
tr.Controls.Add(td);
table.Controls.Add(tr);

the control is adding wel and fine. but now i want to set the css style to the table row.

Thanks in advance
Naina
Posted

1 solution

nainakarri wrote:
the control is adding wel and fine. but now i want to set the css style to the table row.


tr.Attributes.Add("class", "classname");

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900