Ii. ASP. NET Server controls
There are three types of controls that can be added to the ASP. NET page:
● HTML Server Control: the HTML tag, which is located in the namespace of system. Web. UI. htmlcontrols.
● Web Server Control: provides a unified programming model, including methods, and Time ProcessingProgramAndCodeAll are executed on the server. In the namespace system. Web. UI. webcontrols.
● Custom controls and User Controls: Controls customized by developers.
All the server controls we added will automatically become part of the object model. This object model is built for the form in this post code. Basically, the status information of controls on the web form (including input data in the text box and options in the drop-down list) is stored in the hidden viewstate field, which is part of the page generated by the server, and send it to the user. In a complex form, many viewstate values are generated. you can disable the viewstate control that does not need to retain the state information, or disable the viewstate of the entire page, which helps improve the performance.
The modified. aspx. CS file can be displayed without manual compilation (?).
1. Crystal Reports (Control of the Crystal Report Server)
You can view the crystal report information on the Web page.
Ii. Standard (standard Web Server Control)
Label: displays simple text, and uses the text attribute settings and programming to modify the displayed text.
Textbox: provides a text box that you can edit. The autopostback attribute is supported to automatically send the text after the text content is modified. The textchanged event is supported.
Button: The standard button that the user clicks. Click events are supported. Additional properties commandname and commandargument for command event access and reception are supported.
Linkbutton: it is the same as the button, but the button is displayed as a hyperlink.
Imagebutton: displays an image. Its Attributes and events inherit the buttons and images.
Hyperlink: adds an HTML hyperlink. The navigateurl attribute sets the hyperlink. The imageurl attribute specifies the image that replaces the text, and the target attribute specifies the window opening mode.
Dropdownlist: allows you to select a list item and set the list item (a listitem set) using the attribute items. selecteditem and selectedindex are used to determine the selected content. The selectedindexchanged event is supported to determine whether the options have changed; supports the autopostback attribute.
ListBox: allows you to select one or more lists. Set selectionmode to muliple or single to determine the number of options selected at a time. Rows determines the number of options to be displayed. Other options are the same as those of the dropdownlist control.
Checkbox: displays a check box. The selected status is in the checkted attribute; the text is in the text attribute; The autopostback attribute is supported; and The checkedchanged event is supported.
Checkboxlist: create a set of check boxes. For attributes and events, see dropdownlist.
Radiobutton: displays a single-choice button. You can use the groupname attribute to link the radiobutton control to a group. Other attributes are the same as events and checkpoints.
Radiobuttonlist: Creates a group of radio buttons, whose attributes and events are similar to those of other list controls.
Image: displays an image. Use imageurl to index images. If image loading fails, the text corresponding to alternatetext is displayed.
Imagemap: similar to an image, but supports hot zone function redirection provided by the hotspot control to different pages.
Table: Specifies a table. You can set tablerow and tablecell, or set the collection class attribute of tablerow to specify data rows.
Bulletedlist: format an Option List into a project symbol list, which can be displayed in different formats. Click events are supported to determine user return options. <ol>... </ul>, <ul>... </ul>.
Hiddenfield: used to provide hidden fields to store different values. This control can be used to store settings that require another storage mechanism. Use the value attribute to access the stored value.
Literal: performs the same functions as label, but has no style attribute and only one text attribute.
Calendar: allows you to select a date from the image calendar. The basic functions are the selecteddate and visibledate attributes.
Adrotator: Ad flow board that displays several images in sequence. The advertisementfile attribute is used to specify the XML file describing the image. The adcreated event is supported.
Fileupload: allows users to select and upload files, supports the hasfile attribute, and supports the saveas () method of background code for file upload.
Wizard: You can simplify Common Tasks for users to enter data on several pages. You can add multiple steps to the wizard, display them in order or not in order, and rely on this control to maintain the status.
XML: a complex text display control used to display XML content transmitted using XSLT styles.
Multiview: contains one or more View Controls. Only one view control is displayed at a time. You can use the activeviewindex attribute to specify the current state. If the view changes, the activeviewchanged event is triggered.
Panel: The container for adding other controls. You can use horizontalalign and wiap to specify how the content is arranged.
View: the container of the control, similar to placeholder, but mainly acts on the Child control of mulitview. It supports activate and deactivate events to detect changes in the activation status.
Substitution: specify a group of web pages that are not cached together with other outputs.
Location: Same as literal, but allow the use of project resources to specify the text to be displayed in different regions for text localization.
Iii. Data (Data Web Server Control)
Data Web server controls are divided into two types:
● Data source control: to obtain data from different data sources, it is best to configure properties through a graphical wizard. There are two types:
System. Web. UI. datasource (Common Data Source Control)
Objectdatasource: it can process data stored in the created object and quickly display the custom object model in ASP. NET.
Sqldatasource: Uses and operates data pipelines stored in the SQL Server database. The returned object is dataset.
Accessdatasource: The data pipeline stored in the ACCESS database.
System. Web. UI. hierarchicaldatasource (Hierarchical Data Source Control)
Xmldatasource: used to process hierarchical data. You can bind a navigation control or use an XSL style table to transmit XML data.
Sitemapdatasource: can be bound to the map data of a hierarchical site.
● Data Display Control
Gridview: displays multiple data items (such as rows in a database) in the format of data rows. You can select, sort, and edit data items by using the properties of this control.
Datalist: displays multiple data items, provides templates for each item, displays data fields in any specified manner, and selects, sorts, and edits data items.
Detailsview: displays detailed fields of a single data item. You can add, edit, and delete data items.
Formview: displays a data item using a template. You can add, edit, and delete data items.
Repeater: similar to datalist, but cannot select or edit data.
Repeaterviewer: Advanced Control for displaying report service data.
Iv. validation (verify Web server controls)
The verification control can verify user input without writing code. It can also automatically output helpful prompts to users, and even generate client JavaScript Functions to simplify the execution of verification tasks.
Each verification control checks whether the control is valid and changes the value of the isvalid attribute accordingly. If any validation control on the page fails, the isvalid attribute of the entire page is false. In addition, the text stored in errormessage can be output (display attribute) at the location where the verification control is located ), it can also be output in a separate location (using the validationsummary Control) together with the verification controls on other pages ). The controltovalidate attribute is used to specify the programming ID of the control to be verified.
Requiredfieldvalidator: non-empty verification of the input control.
Comparevalidator: checks whether the input data meets simple requirements. An operation set is used for verification through the operator and valuetocompare attributes. Operator sets comparison operators>, <, =; valuetocompare for comparison values; type for comparison setting; and finally compare the controltocompare attribute of another control.
Rangevalidator: Specifies the range between maximumvalue and minimumvalue to verify the input data type.
Regularexpressionvalidator: verifies the content of a field based on the regular expression stored in validationexpression.
Customvalidator: Use a custom function to verify the data of the control and customize the verification. The clientvalidationfunction user sets the Script Function for client verification. The servervalidate event specifies the method for server verification data.
Validationsummary: displays verification errors for all validation controls with errormessage configured. You can use the displaymode and headertext attributes to format the displayed content, set the showsummary attribute to display, and set the showmessagebox attribute to display information in the pop-up dialog box.
5. Navigation (navigation Web Server Control)
Sitemappath: displays the path style information, allows users to view their location in the site structure, and navigate to the parent area.
Menu: supports static or dynamic menu navigation sites.
Treeview: hierarchical data can be displayed in the tree structure. Nodes in the tree are stored in the nodes attribute, and the selected nodes are stored in the selectednode. The selectednodechanged and treenodecollapsed events are supported.
The website map web under the root directory. the sitemap XML file contains a <sitemap> element, which contains a <sitemapnode> element. The <sitemapnode> element can contain multiple nested <sitemapnode> elements. Each element contains the following attributes: title, URL, roles, and description.
When adding a widget, the default provider and current URL are used to format the Link List of the parent page. If you use a custom provider, you can specify the provider ID through the sitemapprovider attribute, or you can use startingnodeoffset to delete the previous layer of menu data (such as the root-level home item ); select whether to delete the top-level link in the showstartingnode attribute of the data source control. Use the startfromcurrentnode attribute to specify whether to start from the current position. Use the stringnodeurl to rewrite the root node.
Map
By default, the provider ignores the roles attribute. the securitytrimmingenable attribute of the config file is set to provide data for the nodes that the current user can view. This visibility is determined by the user's role members.