I am adding labels dynamically to a page, there are a few labels that have to be marked as required . Below is the code
Panel1.Controls.Add(new LiteralControl("<td>"));
if (required)
{
Mynewlabel.Text = lblname + " *";
Mynewlabel.BackColor = System.Drawing.Color.Red;
}
ControlsPanel.Controls.Add(Mynewlabel);
ControlsPanel.Controls.Add(new LiteralControl("</td>"));
Setting Mynewlabel.BackColor makes the complete label back color as red , rather I just want the * sign to be in Red …I am not sure if it is do-able.
Please provide your inputs.
CSS:
Code: