Category: Label & Literal

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 |? 1Label1.Text = "write what you want";2Label1.Font.Bold = true;3Label1.Font.Name = "arial";4Label1.Font.Size = FontUnit.Larger;5Label1.ForeColor = System.Drawing.Color.Red;6Label1.BackColor = System.Drawing.Color.PaleGreen;7Label1.BorderStyle = BorderStyle.Dashed;8Label1.BorderColor = System.Drawing.Color.PaleTurquoise;

Read More…

How to write string on web page in asp.net

{0 Comments}

In order to write string value to web page using c sharp in asp.net, we have to use a method know as response. Write method which will allow writing on a web page. Following is the easiest code snippets to write text on web page.  C# |  copy code |? 1Response.Write("hello world"); This response write method accept a parameter which …

Read More…

How to bold label in asp.net

{0 Comments}

You can apply bold property to asp.net label or any other property in static and dynamically both manner, for static you can simply add css style with property font-weight: bold; and apply same dynamically as follows;  C# |  copy code |? 1Label1.Attributes.Add("style","font-weight:bold");  

Read More…

How to add label dynamically in asp.net

{0 Comments}

Adding a label in asp.net dynamically is very easy, as we know that label is a type of control which on run time creates a span with same id which you assign to label. So we can create label control dynamically in the similar manner in which other controls are created, which is as follows, …

Read More…

How to wrap label text in asp.net

{0 Comments}

How to wrap label text in asp.net

When there is lots chuck of text assign to label in asp.net. It just scattered. To wrap it, you can set following property to get desired result. Following are the important property. Width Word-wrap Word-break display This will definitely help you to get word wrap for label in asp.net. label in asp.net converted to span …

Read More…