Reputation: 3
I have created a dynamic table using below code.It is only a part of my code.
if (i >= startNo && i <= endNo) {
panelName.Controls.Add(new LiteralControl("<td style=background-color:lightblue; > </td>"));
} else {
panelName.Controls.Add(new LiteralControl("<td> </td>"));
}
I need to show a popup/tooltip message if the color is lightblue. Could you please help me out to figure this out?
Upvotes: 0
Views: 2043
Reputation: 17943
You can use the title
property of the td
like folloiwng.
panelName.Controls.Add(
new LiteralControl("<td title='some title' style=background-color:lightblue; > </td>"));
To set some dynamic value from server, you can try like following.
string someToolTip = "Got from DB";
panelName.Controls.Add(
new LiteralControl("<td title='" someToolTip + "' " + "style=background-color:lightblue; > </td>"));
Upvotes: 2