How to assign class to htmltablerow runtime?

 Posted by Bhakti on 12/8/2009 | Category: ASP.NET Interview questions | Views: 6426

With htmltablerow, you cant find property like class/cssclass.
With such situation, you need to add attribute of “Class” to the desired htmltablerow.
With below code, I am adding class “NavyYellow” to found tablerow “trMain”
Dim trMain As HtmlTableRow

trMain = CType(e.Item.FindControl("trMain"), HtmlTableRow)
trMain.Attributes.Add("class", "NavyYellow")

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response