How to apply css to label control from code behind in asp.net

{0 Comments}

Following is the bunch of syntax which will help you to apply css styles from code behind c sharp which is as follows

 C# |  copy code |? 
1
Label1.Text = "write what you want";
2
Label1.Font.Bold = true;
3
Label1.Font.Name = "arial";
4
Label1.Font.Size = FontUnit.Larger;
5
Label1.ForeColor = System.Drawing.Color.Red;
6
Label1.BackColor = System.Drawing.Color.PaleGreen;
7
Label1.BorderStyle = BorderStyle.Dashed;
8
Label1.BorderColor = System.Drawing.Color.PaleTurquoise;

Leave a Comment

Your email address will not be published.