The ASP.NET
Framework (version 3.5) contains over 70 controls. These controls can be
divided into seven groups:
Ø
Standard Controls : The standard controls enable you
to render standard form elements such as buttons,
input fields, and labels.
Ø
Validation Controls : The validation controls enable you to validate form data
before you submit the data to the server. For example, you can use a RequiredFieldValidator
control to check whether a user entered a value for a required input field.
Ø
Rich Controls
: The rich controls enable you to render things such as calendars, file upload buttons, rotating
banner advertisements, and multi-step wizards.
Ø
Data Controls
: The data controls enable you to work with data such as database data. For example, you can use
these controls to submit new records to a database table or display a list of
database records. Navigation Controls. The
navigation controls enable you to display standard navigation elements such as
menus, tree views, and bread crumb trails.
Ø
Login Controls : The login controls enable you to
display login, change password, and registration forms.
Ø
HTML Controls : The HTML controls enable you to
convert any HTML tag into a server-side control.
·
With the exception of the HTML controls, you
declare and use all the ASP.NET controls in a page in exactly the same way. For
example, if you want to display a text input field in a page, then you can
declare a TextBox control like
this:
<asp:TextBox id="TextBox1" runat="Server" />
·
This control declaration looks like the
declaration for an HTML tag. Remember, however, unlike an HTML tag, a control
is a .NET class that executes on the server and not in the web browser.
·
When the TextBox control is rendered to the
browser, it renders the following content:
<input name="TextBox1" type="text" id="TextBox1" />
·
The first part of the control declaration, the asp: prefix, indicates the namespace for
the control. All the standard ASP.NET controls are contained in the System.Web.UI.WebControls
namespace. The prefix asp:
represents this namespace.Next, the declaration contains the name of the
control being declared. In this case, a TextBox
control is being declared.
·
This declaration also includes an ID attribute.
You use the ID to refer to the control in the page within your code. Every
control must have a unique ID.
No comments:
Post a Comment