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

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
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
1 + 5 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2019 CodingFusion
75 Important SQL Server queries you should know