Onlineatoz.net | ToolBox Standard Control Label

ToolBox Standard Control Label

Label Web Server Control

in ASP.NET environment,The Label Web server control eables you to programmatically set text in an ASP.NET Web page. You typically use the Label control when you want to change text in the page at run time which may be page_load event.

Label control Options
  • HTML -you can specify the label using HTML when you need to display Static Text.you dont want the label control which may be used when need to contents via server code.
  • Literal control Like the Label control, the Literal control allows you to programmatically set text to be displayed in the page. However, the Literal control does not support style properties and does not support themes or skins.
  • You can also bind the Label control's Text property to a data source to display database information on a page.
Label Control with Record set Control

The Label control is often used in list Web server controls such as Repeater, DataList, GridView, DetailsView,etc.here, it used to display read-only information from a database. The usual strategy is to add a Label control to a template for one of these controls. You then bind the Label control to a data source.

To add Lable control in a Page
  • Includes the <asp:Label></asp:Label> element in a page.
  • Set the possible Properties of Lable web control such as Id,Text, etc.
  • here, you must specify the Id and runat properties

the following code snippets describes how to Respond to user click via programmatically.

protected void ImageMap1_Click(object sender, ImageMapEventArgs e)
{
Label1.Text="Changed";
}

 
Related Links

Posted by: Admin
Posted on: 9/13/2011 at 12:24 PM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed