A Label control allows you to add text to your web page. Unlike a Literal control, a Label control supports various properties such as CssClass, ForeColor and Font that allow you to style the text that will be rendered. The Label control can also add html tags within the text property of the control.
To provide the ability to style the rendered text, the Label control renders the text assigned to its Text property wrapped in a span tag. The span tag is where the style attributes are applied. Although the addition of the span tag to the rendered markup adds only a small amount of additional bytes for each Label control, these extra bytes can start to add up if you are using Label controls inside of other repeating controls such as a GridView.
If you are not intending to use the styling capabilities of the Label control and simply need a control that can render basic text then you may wish to consider using a Literal control as it will result in slightly less markup being rendered in your page.
Revision number 3, Monday, February 16, 2009 8:00:32 AM by shahed.kazi
You must Login to comment.
Revision #3
Sun, Jun 22, 2008 11:11 AM
by
|
Building a color selector control
This article will show you how to create a color selector control that will looks like the image in the right side. The first thing to mention is the way that we are going to fill the colors. We can manually fill the available colors or we can find a way to
|
Revision #2
Mon, Feb 18, 2008 12:07 PM
by
|
How to Postback Asynchronously from inside a GridView
Concept With the rise of ASP.NET 2.0 AJAX Extensions 1.0, developers were fascinated by the great AJAX Server controls, but they missed that some of them might be harmful if they didn't really know how to usethem ina proper way. One example is when there
|
Revision #3
Wed, Jan 7, 2009 9:34 PM
by
|
Making server side decision based on client side JavaScript
Many of you might have come across the situation where you need to making server side discussion based on client side JavaScript confirm message value. Though this may sound very basic feature, surprisingly large developers struggle when implementing this
|