Figure 2. ASP WEB control
Text display
The Label control is used to display read-only static text or data binding text in the page:
asp: label>
Enter control
Some controls included in the web control group allow the end user to input data that will be processed by the page on the server.
TextBox controls are used to provide text editing capabilities. Similar to the Label control, the text here can also be data binding. The TextBox control supports multiple modes, which can be used to implement single-line input, multi-line input and password input:
asp: textbox>
textbox1 ask: textbox>
asp: textbox>
Checkbox controls are used to generate check boxes that can be switched between two states in selecting and clearance:
asp: checkbox>
The Radiobutton control is similar to the Checkbox control, but it usually forms a set of other Radiobutton controls when used to provide a set of mutually exclusive options:
asp: RadioButton> Asp: radiobutton>
Select control
The following four controls provide mechanisms that allow users to choose from the options to them. The contents of the option list can be static as static as in the following example, or the data source can be dynamically populated.
The DropDownList control provides the ability to display the option as a drop-down list and make a single-selected ability:
asp : The DropDownList> ListBox control displays options in the form of scrolling lists and allows you to select a single or multiple options from it:
Asp: listbox>
CheckBoxList control is used to create a group of Checkbox controls that are displayed as a column or multiple columns:
Asp: checkboxlist>
The RadiobuttonList control is very similar to the CheckboxList control. Different, it uses a set of Radiobutton controls to create a group of mutually exclusive options:
asp : RadiobuttonList>
Form submission and return
The following controls are used to submit pages with user input values to the server to process these values with code in the page. These controls generate a Click event on the server for use in your code.
The Button control can generate a three-dimensional button that can submit the page to the server:
asp: button>
The behavior of the LinkButton control is the same as the Button control. But it will appear as a hyperlink on the page:
asp: button> ImageButton control is also used to submit the page. It will be displayed as an image and can provide the X coordinate and Y coordinate of the user click position:
asp: button>
navigation
The HyperLink control is used to generate links that can jump to other URLs:
" MYPAGE.ASPX> "
Image display
Image controls can display images on the page:
asp: image>
Layout control
Panel controls are often used as a simple combination control and a container for dynamically created controls. (Please note that the Panel control usually does not have visible appearance.)
asp: panel>
The Table control is combined with the related TableRow and Tablecell controls, which can be used to create a table or a form of forming layout:
[0,0] asp: Tablecell> [0, 1 ] Asp: Tablecell> ask: tablelow> [1,0] asp: Tablecell> [1,1] asp: TableCell> Ask: tablelow> asp: table>
Date selection
Calendar control allows users to browse the date and dates (including the selection date range):
property> ... ASP: Calendar>
List bind control
The list binding control is used to display the contents of the data source or list thereof. They provide the ability to create multiple custom and standard layouts. Regarding the data bond, we will use the content of a chapter to say it completely.
The Repeater control is a simple list binding control that uses a template (ie, the HTML code snippet for setting layout) is displayed in a "simple", that is, there is no predefined appearance of the data source:
template> <% # databinder.eval (container.dataitem, "sitename")%> li> template> Ol> template> ask: repeater>
The DataList control also uses templates to display content of the data source that is bound to. In addition, it provides a custom appearance format and layout function:
<% # databinder.eval (container.DataItem, "personname")%> ... template> ... asp: datalist >
The DataGrid control can create a rich list of formats to display the contents of the data source that is bound to. It provides support for sorting, editing, and pagination.
... property> ... asp: datagrid >
The Validation Control Validation control simplifies the work of verifying the content entered. They automatically generate client-end scripts for the upper browser to authenticate on the user's computer before making backhaul, thereby achieving interactivity and a more good page of user friendliness. At the same time, they can also perform the same work as a second defense on the server. Other articles listed in the "Related Reference Information" are described in detail. The RequiredFieldValidator control is used to ensure that users have filled out those input controls that must be entered. The RangeValidator control is used to check the content of the user input within the effective range. This is very useful for the input content of numbers or date types. The CompareValidator control is used to compare the input content in one control and the input content in another control. The RegularExpressionValidator control is capable of checking whether the content entered by the user is compliant as a standard specification expression (or string mode). The CustomValidator control allows you to provide custom server-side and client-end authentication logic. The ValidationsumMary control provides an outline of all error messages generated by the validation control. Zero-Zero Control This, we will explain the Adrotator control in detail in the fourth, verifying the form. Advertising information (including the URL of its image) uses an XML file to define: asp: adrotator>
2.5 HTML controls, Web controls, can produce the same effect, who is better? When developing these controls, we ask yourself if you really need to provide HTML control groups and web control groups with some repetition functions. You must also want to know what the HTML controls and web controls are exactly, and their applicable occasions. The difference between the two sets of controls can be compared by the following aspects. The control abstract HTML control does not have any abstract capabilities. Each control is a one or one (see Table 1). The web control creates a higher level of abstraction, which does not have any corresponding HTML tags (such as Calendar and DataGrid). Because they are not directly mapped to HTML tags, the web control can also function as a merge function in an appropriate occasion (for example, with a TextBox control instead of multiple tags). This abstraction opens a convenient door to use a variety of types of controls provided by third parties. Object Model HTML control provides HTML-centric object model. Each control includes a property set that can use this property set to control the properties of the tag. This property set uses the character string / value pair and is not strong. When using an HTML control, your programming is programs with traditional ASPs. Thus, the HTML control provides a quick transplant path - can convert a tag into a server control by adding a runat = "server" property. The web control provides a form-based, similar to Visual Basic programming mode. They also provide properties set, but their main goal is to provide a format, type safe and consistent object model. Each web control contains a set of standard properties, such as Forecolor, Backcolor, Font, etc. This object model also provides a richer design experience in design tools like Visual Studio .NET. The target browser HTML control does not automatically detect the ability to request a page's browser, nor does it modify the HTML they provide. When using this set of controls, you are responsible for ensuring that your page works at the high-level and low browsers at the same time. The web control can automatically adjust the results they generate to ensure that the output results are equally excellent in advanced browsers and low browsers. Web controls can also provide different behaviors for different browsers to give full play to the potential of the browser. For example, the Validation control can also create a highly interactive page for advanced browsers through the client's script. Control HTML controls for generated HTML allows you to fully control the content displayed and send to the client browser. Web controls offer a more abundant object model, as well as the ability to adapt to a variety of browsers. Thus, they do not provide the same degree of control over the output result. When you develop web applications, you can choose from the ability of the two sets of controls and your needs. You can also choose to mix the two sets of controls on the same page, using a type of control does not hinder your use of another type of control.
2.6 Modifying and Dressing Your Control this is some Literal Text Inside A Styled Span Control span> Note Picture Part, beautiful words Click ME! Button> Beautiful buttons, round Corner, very Cool, don't have to use Photoshop to do dotted box, do not have Photoshop to do, Style is very powerful. ASP: Calender Control
Further example is more beautiful, the setting is also very simple, you will understand. 2.7 The most important precautions pay attention, .NET supported language is not VBScript but VB, so when the variable is declared, it is not a simple DIM.