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:
![Change-label-text-color-programmatically-asp-net-practicle-question-codingfusion](/PostPics/image/Change%20label%20color%20programmatically.gif)
![Change-Label-Text-color-programmatically-asp-net-practice-question-codingfusion](/PostPics/image/Change%20label%20color%20programmatically.gif)