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

 
Best quality Asp .Net Ajax Control Toolkit tutorials.
This site is very useful to learners
26-Oct-2013 From  s.sunanda
Thanks Sunanda for your kind words. Stay tunned for more. I hope you will like my upcoming articles too.
10-Dec-2013 From  Anuj

Give your valuable comments.

Name
Email
Comment
7 + 3 =
 

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