How to apply css style asp button code behind/server side

{0 Comments}

When it comes to apply css style from code behind/server side there are some properties which you can use to do so as we do to style many control. You can use following syntax to style your button according to your requirement.   

 C# |  copy code |? 
01
 protected void Button1_Click(object sender, EventArgs e)
02
    {
03
        Button1.BackColor = System.Drawing.Color.PaleGreen;
04
        Button1.BorderColor=System.Drawing.Color.PaleTurquoise;;
05
        Button1.BorderStyle=BorderStyle.Dashed;
06
        Button1.ForeColor=System.Drawing.Color.Red;;
07
        Button1.Font.Bold = true;
08
        Button1.Font.Name = "arial";
09
        Button1.Font.Size = FontUnit.Larger;
10
    }

Leave a Comment

Your email address will not be published.