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

Change-Label-Text-color-programmatically-asp-net-practice-question-codingfusion

 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice