Online Book Reader

Home Category

Programming Microsoft ASP.NET 4 - Dino Esposito [137]

By Root 5561 0
the Style object.

MergeStyle

Like ApplyStyle, copies any nonempty elements of the specified style to the control. Existing style properties are not overwritten, though.

RenderBeginTag

Renders the HTML opening tag of the control into the specified writer. The method is called right before the control’s RenderControl method.

RenderEndTag

Renders the HTML closing tag of the control into the specified writer. The method is called right after the control’s RenderControl method.

All these methods are rarely of interest to application developers. They are mostly designed to support control developers.

Core Web Controls


The set of Web controls can be divided into various categories according to the provided functionality—input and button controls, validators, data-bound controls, security-related controls, grid and view controls, plus a few miscellaneous controls that provide ad hoc functions and are as common on the Web as they are hard to catalogue (for example, calendar, ad rotator, and so forth).

In this chapter, we’re focused on covering the most common and essential Web controls, such as the controls for capturing the user’s input and posting data to the server. Table 6-11 details the core server controls of ASP.NET. (Other more advanced controls will be covered later when discussing input forms and data binding.)

Table 6-11. Core Web Controls

Control

Description

Button

Implements a push button through the tag.

CheckBox

Implements a check box through the tag.

FileUpload

Allows users to select a file to upload to the server.

HiddenField

Implements a hidden field.

HyperLink

Implements an anchor tag, and lets you specify either the location to jump to or the script code to execute.

Image

Implements a picture box through the tag.

ImageButton

Displays an image and responds to mouse clicks on the image like a real button.

ImageMap

Displays an image and optionally defines clickable hot spots on it.

Label

Represents a static, nonclickable piece of text. It’s implemented through the tag.

LinkButton

Implements an anchor tag that uses only the ASP.NET postback mechanism to post back. It is a special type of hyperlink where the programmer can’t directly set the target URL.

Localize

Reserves a location on a Web page for you to display localized text.

MultiView

Represents a control that acts as a container for a group of child View controls.

Panel

Implements an HTML container using the

block element. In ASP.NET 2.0, the container supports scrolling. Note that in down-level browsers the control renders out as a .

RadioButton

Implements a single radio button through the tag.

Table

Implements the outer table container. It’s equivalent to the HTML

element.

TableCell

A table cell; it’s equivalent to the HTML

element.

TextBox

Implements a text box using the or

element.

TableRow

A table row; it’s equivalent to the HTML