Professional Documents
Culture Documents
ASP.NET
ASP.NET
ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be
executed by an Internet server.
Note: ASP+ is just an early name used by Microsoft when they developed ASP.NET.
When a browser requests an HTML file, the server returns the file
When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on
The ASP.NET engine reads the file, line by line, and executes the scripts in the file
Features of ASP.NET
1.
2.
3.
4.
5.
6.
7.
8.
Language Support: ASP.NET uses ADO.NET and supports full Visual Basic, ASP.NET supports
C#, C++, JScript.
ASP.NET Controls: ASP.NET control objects that can be controlled by scripts. ASP.NET also
contains a new set of object-oriented input controls, like programmable list-boxes and
validation controls.
Event Aware Controls: All ASP.NET objects on a Web page can expose events like Load, Click
and Change events handled by code makes coding much simpler and better organized.
ASP.NET Components: ASP.NET components are heavily based on XML.
User Authentication: ASP.NET supports form-based user authentication, cookie
management, and automatic redirecting of unauthorized logins.
High Scalability: ASP.NET provides greater scalability. Server-to-server communication has
been greatly enhanced, making it possible to scale an application over several servers.
Compiled Code: The first request for an ASP.NET page on the server will compile the ASP.NET
code and keep a cached copy in memory. The result of this is greatly increased performance.
Easy Configuration and Deployment: Configuration of ASP.NET is done with plain text files.
Configuration files can be uploaded or changed while the application is running.
Facilities in ASP.Net
1.
Master Pages: A master page is a template for other pages, with shared layout and functionality.
The master page defines placeholders for content pages. The result page is a combination (merge)
of the master page and the content page.
2.
3.
Themes: Themes allow developers to create a customized look for web applications. Design goal
for theme are:
a) to make it simple to customize the appearance of a site
b) Allow themes to be applied to controls, pages, and entire sites
c) Allow all visual elements to be customized
Web Parts: ASP.NET 2.0 Web Parts can provide a consistent look for a site, while still allowing
user customization of style and content.
a) New controls: Zone controls - areas on a page where the content is consistent
b) Web part controls - content areas for each zone
4.
5.
6.
7.
8.
9.
Security: Security is very important for protecting confidential and personal information. In
ASP.NET 2.0 the Login controls has been added, specifically, for this security purpose.
Roles and Personalization: Internet communities are growing very popular. ASP.NET 2.0 has
personalization features for storing user details.
Internationalization: Reaching people with different languages is important if you want to reach
a larger audience. ASP.NET 2.0 has improved support for multiple languages.
Data Access: A key goal of ASP.NET 2.0 was to ease the use of data sources. ASP.NET 2.0 has
new data controls, removing much of the need for programming and in-depth knowledge of data
connections.
Mobility Support: The problem with Mobile devices is screen size and display capabilities. In
ASP.NET, the Microsoft Mobile Internet Toolkit (MMIT) provided this support. In ASP.NET 2.0, MMIT
is no longer needed because mobile support is built into all controls.
Images: ASP.NET 2.0 has new controls for handling images:
a) The ImageMap control - image map support
b) The DynamicImage control - image support for different browsers
10. Automatic Compilation: ASP.NET 2.0 provides automatic compilation. An entire web site can be
pre-compiled. This provides an easy way to deploy compiled an applications, and because only
compiled files are deployed, the source code is protected.
1.
2.
3.
Programming languages:
a. C# (Pronounced C sharp)
b. Visual Basic (VB .NET)
c. J# (Pronounced J sharp)
Server technologies and client technologies:
a. ASP .NET (Active Server Pages)
b. Windows Forms (Windows desktop solutions)
c. Compact Framework (PDA / Mobile solutions)
Development environments:
a. Visual Studio .NET (VS .NET)
b. Visual Web Developer
ASP.NET has better language support, a large set of new controls, XML-based components, and better
user authentication. ASP.NET provides increased performance by running compiled code.
Description
HtmlAnchor
HtmlButton
HtmlForm
HtmlGeneric
HtmlImage
HtmlInputButton
HtmlInputCheckBox
HtmlInputFile
HtmlInputHidden
HtmlInputImage
HtmlInputRadioButton
HtmlInputText
HtmlSelect
HtmlTable
HtmlTableCell
HtmlTableRow
HtmlTextArea
Description
AdRotator
Button
Calendar
Displays a calendar
CalendarDay
CheckBox
CheckBoxList
DataGrid
DataList
DropDownList
HyperLink
Creates a hyperlink
Image
Displays an image
ImageButton
Label
LinkButton
ListBox
ListItem
Literal
Panel
PlaceHolder
RadioButton
RadioButtonList
BulletedList
Repeater
Style
Table
Creates a table
TableCell
TableRow
TextBox
Xml
Description
CompareValidator
CustomValidator
RangeValidator
RegularExpressionValidator
RequiredFieldValidator
ValidationSummary
Note: Login controls might not run function correctly if Method of ASP.net Web Page is changed from
POST to GET.
It includes following controls:
The
The
The
The
The
The
The
Login Control
LoginView Control
LoginStatus Control
LoginName Control
PasswordRecovery Control
CreateUserWizard Control
ChangePassword Control
2.
3.
4.
5.
6.
7.
The Login Control: The Login control displays a user interface for user authentication. The
Login control contains text boxes for the user name and password. The Login control can be
used as a standalone control on page.
The LoginView Control: The LoginView control allows you to display different information to
anonymous and logged-in users. The control displays one of two templates: the
AnonymousTemplate or the LoggedInTemplate. The LoginView control also includes events for
ViewChanging and ViewChanged, which allow you to write handlers for when the user logs in
and changes status.
The LoginStatus Control: The LoginStatus control displays a login link for users who are not
authenticated and a logout link for users who are authenticated. The login link takes the user
to a login page. The logout link resets the current user's identity to be an anonymous user.
The LoginName Control: The LoginName control displays a user's login name if the user has
logged in using ASP.NET membership.
The PasswordRecovery Control: The PasswordRecovery control allows user passwords to
be retrieved based on the e-mail address that was used when the account was created. The
PasswordRecovery control sends an e-mail message containing a password to the user.
The ChangePassword Control: The ChangePassword control allows users to change their
password. The user must first supply the original password and then create and confirm the
new password. If the original password is correct, the user password is changed to the new
password. The control also includes support for sending an e-mail message about the new
1password.
The CreateUserWizard Control: The CreateUserWizard control collects information from
potential users. By default, the CreateUserWizard control adds the new user to the ASP.NET
membership system.The CreateUserWizard control gathers the following user information:
(1) User name
(2) Password
(3) Confirmation of password
(4) E-mail address
(5) Security question
(6) Security answer
2.
3.
4.
5.
1.
2.
3.
1.
Dynamic menus
2.
Tree Views
3.
Dynamic Menu: The <asp:Menu> control displays a standard site navigation menu. The
<asp:SiteMapDataSource> control automatically connects to the default sitemap file
(web.sitemap).
TreeView: The <asp:TreeView> control displays a multi level navigation menu. The menu looks
like a tree with branches that can be opened or closed with + or - symbol.
The
<asp:SiteMapDataSource> control automatically connects to the default sitemap file
(web.sitemap).
SiteMapPath: The SiteMapPath control displays the trail (navigation path) to the current page.
The path acts as clickable links to previous pages. The SiteMapPath control uses the web.sitemap
file by default.
Master Pages
Master Pages define the overall layout of the web application.Master pages allow you to create a
consistent look and behavior for all the pages (or group of pages) in your web application. A master
page provides a template for other pages, with shared layout and functionality. The master page
defines placeholders for the content, which can be overridden by content pages. The output result is a
combination of the master page and the content page. The content pages contain the content you
want to display.
When users request the content page, ASP.NET merges the pages to produce output that combines
the layout of the master page with the content of the content page.
Ex.
ASP.NET Authentication:
ASP.NET implements additional authentication schemes using authentication providers, which are
separate from and apply only after the IIS authentication schemes. ASP.NET supports the following
authentication providers:
1.
2.
3.
4.
Windows (default)
Forms
Passport
None
To enable an authentication provider for an ASP.NET application, use the authentication element in
either machine.config or Web.config as follows:
<system.web>
<! -- mode=[Windows|Forms|Passport|None] -->
<authentication mode="Windows" />
</system.web>
1. Windows: The Windows authentication provider relies upon IIS to perform the required
authentication of a client. After IIS authenticates a client, it passes a security token to
ASP.NET. ASP.NET constructs and attaches an object of the WindowsPrincipal Class to the
application context based on the security token it receives from IIS. It authenticates using
Windows accounts. It may require the use and management of individual Windows user
accounts.
2. Forms (Cookie): The Forms authentication provider is an authentication scheme that makes
it possible for the application to collect credentials using an HTML form directly from the client.
The client submits credentials directly to your application code for authentication. If your
application authenticates the client, it issues a cookie to the client that the client presents on
subsequent requests. If a request for a protected resource does not contain the cookie, the
application redirects the client to the logon page. It can be used for personal authentication.
3. Passport: The Passport authentication provider is a centralized authentication service
provided by Microsoft that offers a single logon and core profile services for member sites.
Passport is a forms-based authentication service. When member sites register with Passport,
the Passport service grants a site-specific key. The Passport logon server uses this key to
encrypt and decrypt the query strings passed between the member site and the Passport
logon server.
4. None (Custom Authentication): Specify "None" as the authentication provider when users
are not authenticated at all or if you plan to develop custom authentication code. It offers
total control of the authentication process providing the greatest flexibility.