Detuction ASP.NET (4) Green Apple Studio (Compilation) 01-5-21 09:50:43
WEB control
You may worry, like
input>
The corresponding web control is this:
In both, you can notice that the web control is identified by code "ASP:" namespace, and in XML, use the slash to end the element. You don't have to use XML format, you can also use the HTML format, with a semicolon to end the tag: asp: textbox>. But you will find that XML format is used in many code examples, and the number of code words is also more concise. The namespace must be used, it is responsible for identifying the text box TextBox control from. All standard Web controls are part of the ASP namespace. This is important when writing your own control.
The TextBox control is like a standard input box, but you should consider the three input controls below:
They are all used for HTML input, but there is no consistency. But if you use the following, is it simpler?
You can see that a simple control contains the functions of three controls in HTML, and more easy to memorize, easier to encode.
ASP.NET carries 5 Class WEB controls:
• Inherent controls corresponding to HTML
• Provide a list of data streams on the page
• Provides a richest UI (user interface) content and features of the Rich control
• Complete confirmation controls for various form validation
• Package WML mobile control for WAP device
The inherent server control is the same as the HTML control, but it is more reasonable to provide more consistent use. These controls include linkButton, ImageButton, HyperLink, TextBox, Checkbox, Radiobutton, DropdownList (drop-down list), Listbox ( List box), Image (Image), Label, Panel, Table, TableRow, Tablecell (Table Unit).
The list control includes a REPER (transponder), a DataList (data list), and a DataGrid (data grid). The list control also includes RadiobuttonList and checkboxlist (list of checkbox) so that the list of creating radio boxes and check boxes is simple. The RICH control includes Calendar and ADROTATOR (rotation). The Calendar control outputs pure HTML for a low browser to output DHTML (such as Internet Explorer 5.0) for advanced browsers. ADROTATOR output image, it has built-in rotation code.
Confirmation control includes RequiredFieldValidator (request domain confirmation), Compare Validator, RangeValidator, RegularExpressionValidator, CustomValidator, and Validationsummary (confirmation summary). These controls provide a simple way for developers to establish a confirmation in form processing.
Information about mobile controls is now not released, but it can be sure they help construct a Web site that activates WAP.
Write new controls
You don't necessarily only only limit the controls provided by these systems, and write controls is quite simple. For example, if you want a control to encapsulate two text boxes (probably the input domain of the name, you can write the code:
asp: panel>
You can save this code in the file name.aspc (note this new extension) and treat it as a web form control. Next, you can add the following to the web form:
<% @ Register tagname = "namecontrol" tagprefix = "foo" src = "name.aspc"%>