Server Controls


The following table lists some of the principal Web server controls available with .NET 2.0, and the HTML code that is returned by these controls.

Control

HTML

Description

Label

<span>

The Label control returns a span element containing text.

Literal

static text

If simple static text should be returned, the Literal control can be used. With this control, it is possible to transform the content depending on the client application.

TextBox

<input type="text">

The TextBox control returns HTML <input type="text"> where the user can enter some values. You can write a server-side event handler when the text changes.

Button

<input type= "submit">

The Button control is used to send form values to the server.

LinkButton

<a href="javascript: __dopostback()>

The LinkButton creates an anchor tag that includes JavaScript for doing a postback to the server.

ImageButton

<input type="image">

With the ImageButton control an input tag of type image is generated to show a referenced image.

HyperLink

<a>

The HyperLink control creates a simple anchor tag referencing a Web page.

DropDownList

<select>

The DropDownList creates a select tag where the user sees one item and can select one of multiple items by clicking on the drop-down selection.

ListBox

<select size="">

The ListBox control creates a select tag with a size attribute that shows multiple items at once.

CheckBox

<input type= "checkbox">

The CheckBox control returns an input element of type check box to show a button that can be selected or deselected. Instead of using the CheckBox you can also use a CheckBoxList that creates a table consisting of multiple check box elements.

RadioButton

<input type="radio">

The RadioButton control returns an input element of type radio. With a radio button just one button of a group can be selected. Similar to the CheckBoxList, RadioButtonList provides a list of buttons.

Image

<img src="/books/3/459/1/html/2/">

The Image control returns an img tag to display a gif or jpg file on the client.

Calendar

<table>

The Calendar control is a complex control to display a complete calendar where a date can be selected, the month can be changed, and so on. For output, an HTML table with JavaScript code is generated.

TreeView

<div><table>

The TreeView control returns a div tag that includes multiple table tags, depending on its content. JavaScript is used to open and close the tree on the client.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net