Write a program to change color of Label text control programmatically in Asp .Net
Write a program to change color of Label text control programmatically in Asp .Net
HTML:
<%--//===== Label to show output.--%>
|
|
Code Behind:
protected void btnRed_Click(object sender, EventArgs e)
{
lblResult.ForeColor = Color.Red;
}
protected void btnGreen_Click(object sender, EventArgs e)
{
lblResult.ForeColor = Color.Green;
}
protected void btnBlue_Click(object sender, EventArgs e)
{
lblResult.ForeColor = Color.Blue;
}
Final Output: