download 2.0 INTRODUCTION 2.1 OBJECTIVES OF THE UNIT ... 2 ASP.Net 2.0 INTRODUCTION ASP.NET 2.0 allows you to

If you can't read please download the document

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of 2.0 INTRODUCTION 2.1 OBJECTIVES OF THE UNIT ... 2 ASP.Net 2.0 INTRODUCTION ASP.NET 2.0 allows you to

  • 2 ASP.Net


    ASP.NET 2.0 allows you to create customizable data-driven Web applications by providing controls, such as DataSource and Login. It also provides various security related controls, such as the Login and LoginName controls to enhance the security of a Web application.

    This ReferencePoint introduces the new features and enhancements provided by ASP.NET 2.0. It explains how to use ASP.NET 2.0 to deploy and manage Web applications.


    • Introduction to ASP.NET

    • Features of the new technology

    • The basic difference between ASP and ASP.NET

    • The new paradigm model

    • The key elements that comprise the .NET framework

    • The key design goals and technology of ASP.NET


    ASP.NET is the latest incarnation of Microsoft’s Active Server Pages (ASPs) and is the engine that executes ASP.NET web pages. An ASP.NET web page is the pro- gram that you create to generate a dynamic web page. It helps in creating dynamic web pages that responds to the requests made by the visitors to your site, such as to display their account status and to process an order.


    Some new features of ASP.NET 2.0 are:

    (a) Master pages, themes, and skins: Enable you to customize the appearance of a Website.

  • ASP .Net 25

    • CreateUserWizard: Helps create a registration page through which an end -user can enter registration information in a database. The syntax generated when you add a CreateUserWizard control to a Web page is:

    • LoginStatus: Provides automatic links to the Web pages, through which an end-user can log on or log out of a Web application. The syntax generated when you add a LoginStatus control to a Web page is:

    • LoginName: Displays the name of the end-user logged on to a Web application. The syntax generated when you add a LoginName control to a Web page is:

    • LoginView: Displays the content of a Web application, depending on the role of an end-user. End-users can access only those parts of the Web application that the Web site administrator assigns to them. The syntax generated when you add a LoginView control to a Web page is:

    • PasswordRecovery: Helps an end-user to retrieve a lost password. The syntax generated when you add a PasswordRecovery control to a Web page is:

    • ChangePassword: Enables an end-user to change a password. The syntax generated when you add a ChangePassword control to a Web page is:


    The provider model of ASP.NET 2.0 provides the infrastructure to implement security in an ASP. NET Web application. The provider model contains two distinct security providers:

    (a) Membership Provider: Helps store end-user information, such as login names and passwords.

    (b) Role Provider: Helps store end-user roles.

    ASP.NET 2.0 contains two membership providers, AccessMembershipProvider and SqlMembershipProvider. AccessMembershipProvider is the default membership provider that stores the login names and passwords in a Microsoft Access database. The Microsoft Access database is automatically created when you create a new Web application. SQLMembershipProvider helps store the login names and passwords in a Microsoft SQL Server database. You need to modify the default Membership Provider for the Web application in the Web.config file to use SqlMembershipProvider, as shown in the following syntax:

  • ASP .Net 27

    • CatalogZone: Helps an end-user to add a WebPart to the Web page through templated con- trols. The CatalogZone control provides two types of templated controls to generate a list of available WebParts in a Web page:

    (a) PageCatalogPart: Generates a list of WebPart controls for a Web page which were earlier removed by an end -user.

    (b) TemplateCatalogPart: Generates a list of new WebParts for a Web page which were not included by an end -user.

    • EditorZone: Helps an end-user change the layout of the WebPart controls. The EditorZone control provides three editing controls to change the appearance of a WebPart control:

    (a) AppearanceEditorPart: Helps change the appearance of a WebPart control.

    (b) LayoutEditorPart: Helps change the layout of a WebPart control.

    (c) BehaviourEditorPart: Helps change the behavior of a WebPart control.


    The personalization framework of ASP.NET 2.0 helps identify and register end-users and store end -user information using various functions and controls. The Web application uses the stored profile of the end-users to display the content according to the requirement of the end- users. For example, an end-user customizes a part of a Web application according to personal requirements. The person- alization framework stores the setting of the Web application and displays the same content when the end-user visits the Web site again. The Web application should perform the following tasks to personalize a Web application:

    Identify the end-user logging on to a Web application. The Web application should be able to differentiate the requests of one end-user from another.

    Provide a personalized experience. This includes allowing or disallowing various actions to the end user. For example, a particular end user can view an annual report, customize a Web page, or keep track of other end user information.

    Store end user information. The Web application needs to store end user information between the Web page requests or between sessions. The end user information can include the identity of an end user, such as login and password.

    You need to configure the personalization properties of the end users so that a Web application can perform the various tasks.

    Note: Personalization properties are defined in the section of the Web.config file present in the root directory of the Web application.


    The code-behind model helps separate the user interface and the logic of a Web application into separate files. The two files that the code-behind model of ASP.NET 2.0 uses to separate a Web page are:

    • Content file: Contains the presentation content, such as Web forms of the Web application. Content files store information about the user interface and are saved as .aspx.

    • Code-behind file: Contains logic of the Web application to perform some action. Code- behind files are saved as .aspx.vb.

  • 28 Dot Net Technology

    The separation of Web application files helps manage and debug the code of the Web application.

    Figure 2.1 shows the code-behind model for ASP.NET 2.0:

    Fig. 2.1 The Code-Behind Model.

    This figure shows the execution of the code-behind file and content file of ASP.NET 2.0.

    In ASP.NET 2.0, when a .aspx Web page with a code-behind file is requested, the .aspx and the code-behind files are combined into a single class at run time rather than two separate classes. You do not need to compile a code-behind file separately because it is automatically compiled when the end user requests a Web page. In the earlier version of ASP .NET, the code-behind files and any other supporting classes are compiled into MSIL. The compiled code is first stored in a file called assembly, and then the individual .aspx files are compiled at run time. ASP.NET 2.0 provides the following compilation options depending on your specific needs:

    • Normal compilation: Compiles the code-behind files and .aspx pages separately. • Batch compilation: Enables you to compile an ASP.NET Web application when you request

    a single Web page of a Web application.

  • ASP .Net 29

    • Deployment pre-compilation: Provides a new compilation method, which allows compila- tion of all the code-behind files, .aspx pages, and HTML and graphic resources of a Web application prior to deployment of the Web application on the Web server. You cannot make any changes to the Web application after deploying it on the Web server.

    • Full-run time compilation: Compiles the Web application at run time. You can use the full-run time compilation feature to modify the Web application after its deployment.


    ASP.NET 2.0 allows you to create Web pages that generate output in different mobile devices, such as mobile phones and Personal Digital Assistants (PDAs). ASP.NET 2.0 introduces several mobile controls that are compatible with a wide variety of mobile devices. The mobility support of ASP.NET 2.0 helps create a common Web page that can be requested by browsers, mobile phones, or PDAs. For example, a Calendar control can generate output in different formats, such as HTML and WML depending on the devices the end users are using to request the Web page.

    ASP.NET 2.0 introduces two mobile controls:

    (a) ContentPager: Allows you to divide a Web page into separate sections that display Web page content in mobile devices.

    (b) PhoneLink: Provides a link to the phone number when a phone call is initiated from a mobile phone. The PhoneLink control has a property called PhoneNumber, which specifies the phone number to be linked.

    In addition to these two mobile controls, ASP.NET provides an attribute called SoftKeyLabel. You can integrate this attribute with the ASP.NET mobile controls to link a soft key button to a mobile control that performs associated action. For example, when you press the dial soft key button on a mobile phone, a specified phone number is linked and a cal