0% found this document useful (0 votes)
26 views

Server Controls

Uploaded by

manthanb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Server Controls

Uploaded by

manthanb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Asp.

net Controls

HtmlControls are just programmable HTML tags. By default these tags are literal text and you can't
reference them with server side code. To "see" any HTML tag with your ASP.NET server side code
you need to add runat="server" and some value to ID parameter. For example, to work with
<textarea> HTML tag with server side code, you can use HTML code like this:

<textarea runat="server" id="TextArea1" cols="20" rows="2"></textarea>

Asp. Net Server Controls

Asp.net provides a built in set of controls that are collectively referred an Asp.net
web server controls.

Web server controls includes form controls such as button, label, textbox along with
special –purpose like grid, calendar, ad rotator and etc.

They are derived from the System.web.UI.WebControls.

Asp.net controls offers following features.

1) All Asp.net controls has two mandatory attributes like runat=server and Id.
2) These controls provide a rich object model that uses familiar oo techniques
along with type safety.
3) The controls automatically detect the browser identifying its capabilities to
render appropriate markup.
4) It support themes that guarantee consistent look and feel for controls
throughout the site.
5) <td class="style3">
6) <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
7) asp is a prefix for server control

Asp.net Web Server Control types

Data Controls : A data source control interacts with the data-bound controls and hides the complex data
binding processes. These are the tools that provide data to the data bound controls and support execution of
operations like insertions, deletions, sorting and updates. There are two types of ASP.NET data controls
Data Source controls, which allow you to set properties for connections to database or XML
data sources, and Data controls, which allow you to display data from data sources specified
in Data Source controls.

Data Source Controls

 SqlDataSource control
 XmlDataSource control
 SiteMapDataSource control

Data Controls

 DataList control
 DetailsView control
 FormView control
 GridView control

Login Controls: The ASP.NET login controls provide a robust login solution for ASP.NET
Web applications without requiring programming. By default, login controls integrate with
ASP.NET membership and forms authentication to help automate user authentication for a
Web site

The Login control displays a user interface for user authentication. The Login control
contains text boxes for the user name and password and a check box that allows users to
indicate whether they want the server to store their identity using ASP.NET membership and
automatically be authenticated the next time they visit the site.

 Login Name Control


 The password recovery control
 Login status control
 Login control

Navigation Controls: Navigation controls are very important for


websites.Navigation controls are basically used to navigate the user through
webpage .It is more helpful for making the navigation of pages easier .There
are three controls in ASP.NET ,Which are used for Navigation on the webpage.

 TreeView control
 Menu Control
 SiteMapPath control

Validation controls: An important aspect of creating ASP.NET Web pages for user input
is to be able to check that the information users enter is valid. ASP.NET provides a set of
validation controls that provide an easy-to-use but powerful way to check for errors and, if
necessary, display messages to the user..

 RequiredFieldValidator:
Use the RequiredFieldValidator control to make an input control a mandatory field.
The input control fails validation if the value it contains does not change from its
initial value when validation is performed. This prevents the user from leaving the
associated input control unchanged. By default, the initial value is an empty string
(""), which indicates that a value must be entered in the input control for it to pass
validation.

 RangeValidator

The RangeValidator does exactly what the name implies; it makes sure that the user input
is within a specified range. You can use it to validate both numbers, strings and dates, which
can make it useful in a bunch of cases.

 CompareValidator

Evaluates the value of an input control against a constant value or the value of
another input control to determine whether the two values match the
relationship specified by a comparison operator (less than, equal to, greater
than, and so on

 RegularExpressionValidator

The RegularExpressionValidator control is used to ensure that an input value


matches a specified pattern.

Both server- and client-side validation are performed unless the browser
does not support client-side validation or the EnableClientScript property is
set to false.

The validation will not fail if the input control is empty. Use the
RequiredFieldValidator control to make the field required

 CustomValidator

If existing ASP.NET validation controls do not suit your needs, you can define a
custom server-side validation function and call it using the CustomValidator
control. You can also add client-side validation to check user input before the
page is submitted by writing a function in ECMAScript (JavaScript) that duplicates
the logic of the server-side method.

 ValidationSummary

The ValidationSummary control allows you to summarize the error messages


from all validation controls on a Web page in a single location. The summary can
be displayed as a list, a bulleted list, or a single paragraph, based on the value of
the DisplayMode property. The error message displayed in
theValidationSummary control for each validation control on the page is
specified by the ErrorMessage property of each validation control. If
theErrorMessage property of the validation control is not set, no error message
is displayed in the ValidationSummary control for that validation control. You
can also specify a custom title in the heading section of
the ValidationSummary control by setting the HeaderText property.
Standard Web Server Controls categorization.

Intrinsic Control: These classes duplicate the functionalities of basic HTML


elements but have a more consistent and meaningful set of properties and methods
that make it easier for the developer to declare and access them.

 Label
 TextBox
 Button
 Radio button
 Check box
 Image
 Hyperlink

List Controls: The List controls enable us to display simple lists of options. For
example, we can use the RadioButtonList control to display a group of radio
buttons, or the BulletedList control to display a list of links. In this series of article
we will also discuss on DropDownList, RadioButtonList, ListBox, CheckBoxList, and
BulletedList controls too. We will also discuss how to bind them to a data source
such as a database tables. .

 The DropDownList,
 The CheckBoxList,
 The RadioButtonList, and
 The ListBox
Rich controls: It provides an object model that has a complex HTML
representation. A typical rich control can often be programmed as a single object
but renders itself with a complex sequence.

 Adrotator
 Calender Control
 MultiView

You might also like