1. Trang chủ
  2. » Công Nghệ Thông Tin

Asp.net slide10

32 240 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Configuring An Application In Asp.net
Trường học University of Technology
Chuyên ngành Computer Science
Thể loại Bài giảng
Năm xuất bản 2023
Thành phố Hanoi
Định dạng
Số trang 32
Dung lượng 240,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Asp.net slide

Trang 1

Session 19

Configuring an Application in ASP.NET

Trang 2

 A service has two characteristics: Interface and Registration

 Web services reduce the “communication-gap” among the Web applications,

enhancing interactivity Web sites thereby group together to form a constellation, providing users a rich user experience

 Advantages of Web Services

 Cross business integration

 Improved efficiency

 Closer customer relationships

 Facilitation of just-in-time integration

 The extension of a Web service file in NET is asmx

 The [WebMethod] tag notifies the ASP.NET compiler that the method to follow should be a Web method, which is to be exported onto the Web

Trang 3

 WSDL is the short form for Web Services Description Language WSDL is the

grammar for a Web service, or moreover, could be thought of as a language that describes or portrays a Web service

 The proxy class does not contain any application logic Instead, it contains the

transporting logic as to how the parameters would be passed, and the result

retrieved

 The proxy class will also contain a list of all the methods that are present in the Web service and their prototypes

 UDDI is the abbreviation for Universal Description, Discovery and Integration

 UDDI helps in registering the services provided by the service providers, so that

they can be shared It also helps the service consumers or Web users in locating the Web services

Trang 5

Web Pages – Web

Application

 Individual web pages together form a web application

 Advantage of grouping individual pages together into an

application, is that values can be set for all these pages at

once, by setting the properties of the application

 The setting of values for the properties of an application

that will control the application at runtime, is known as

configuring the ASP.NET application

Web Page Web Page

Web Page Web Page

Web Page - -

WEB APPLICATION

Trang 6

ASP.NET provides the configuration files that are needed to

customize the web site These files offer remarkable flexibility

to the web applications

Trang 7

Features of Configuration Files

 Stored in plain text format

 Written in XML Rules for naming tags and attributes

 No need to restart server in case of changes

Trang 8

Rules for naming the Tags

Pascal-case : first character is

uppercase, and the first letter of any subsequent concatenated words is

uppercase Exceptions being true and

false, which are in lowercase.

Attribute values

Camel-cased : First character of a tag

name is lowercase, and the first letter

of any subsequent words is uppercase Tag and attribute names

Rule Type of Tags

Trang 9

Types of Configuration Files

Only one file per ASP.NET installation on a machine

 XML based file stored in the web application directory of the

web server

 One file per each directory of the web application

Trang 10

Types of Configuration Files –

Contd…

Web

Applications

One per machine

One per application

Override settings of machine.config

Trang 11

Structure of Configuration

Files

 The configuration file encloses all the tags within the

configuration tags, which if not done, the compiler throws

an exception

 The configuration properties of the machine are set

between these tags

 Within the configuration tags, the configuration

information is grouped into two categories:

 configuration section handler declaration area

 configuration section settings area

 Configuration sections are defined between

<configSections> and </configSections> tags

The individual sections are defined using the <section>

tag

Trang 13

Configuration Section Handler Declaration Area

 Defines a class (usually a NET base class) that

will be used to interpret the configuration data

 This section is enclosed between the

<configSections> tag

 Generally, this section is placed in the

Machine.Config file, and need not be placed in

each and every Web.Config file, as it will be

inherited automatically (from Machine.Config)

Trang 14

Configuration Sections Settings Area

 Defines the actual settings for some particular

option

 Contains the section handlers in which the

configuration code is written

 Each of the section handlers is grouped in a

<sectionGroup>, that offers a structure to

the configuration file

 There are around 30 different configuration

settings already defined in the Machine.config

file

Trang 15

Page Configuration Settings

The page configuration settings allow the developer to control

some of the default behaviors for all the ASP.NET pages in the

Buffer

Default Value Description

Property

Trang 16

Application Setting

 The application settings section is enclosed between the

<appSettings> and </appSettings> tags

 These settings allow the user to set the application configuration details.

 Application settings enable to store and retrieve information as value pairs

key- It is also possible to store, SQL queries

Trang 17

Compilation

Setting

 The compilation settings section is used to specify the compilation options that

are necessary to compile the application source files

 References of the assemblies that are required during compilation can be

specified here

 It is also possible to specify whether to run the application in a debug mode

Provides a semicolon separated list of language ‑names to use in a dynamic compilation of files For example, "C#; VB"

Attribute

Trang 18

In the compilation section, the debug property is set to

false, and at the same time the default language is set to

C#.

Trang 19

Sub-tags of Compilation tag

Trang 20

Sub-tags of Compilation tag

Trang 21

Sub-tags of Compilation tag Contd…

<compilers> sub-tag

<compilers> sub-tag is used to specify the compiler and the language that

is used to create the application

Trang 22

customErrors Setting

 ASP.NET provides the flexibility to write custom error

pages, and redirect the browser (client) to these error

pages when any specific error occurs

 The error pages to be displayed can be designed to give a more polite and user-friendly explanation of the error and its cause

Trang 24

Exploring ASP.NET / Session 19 / 24 of 31

The process of identifying the valid user/password, and providing services

accordingly, is known as Authentication The settings can be specified in the

web.config file itself

Trang 25

Authentication Types

Specifies Windows authentication as default authentication mode Used for any form of IIS authentication

Specifies ASP.NET forms-based authentication as default authentication mode Widely used method

Specifies Microsoft Passport authentication as default authentication mode

No authentication Used by anonymous users and applications providing own authentication

WINDOWS

FORMS

PASSPORT

NONE

Trang 26

Attributes of <forms>

tag

Validation scheme verifies whether the contents of an

encrypted cookie have been altered in transit Validation

Cookie should not be stored as plain text but should be encrypted for protection

Attribute

To use Form Authentication, the authentication mode needs to be specified as

Forms, in which case the <forms> sub-tag can be supplied having following

attributes

Trang 27

Attributes of <forms> tag

Path for cookies issued by the application Default value

Attribute

Trang 28

Forms Authentication Example

<user name="User1" password="user1!"/>

<user name="User2" password="user2@"/>

<user name="User3" password="user3#"/>

Trang 29

 After setting the authentication settings for an

application, access rights need to be assigned

as to who can access the application

 Setting these access rights is known as

Authorization

 Using Authorization settings, users are actually

authorized to access the website

<authorization>

<allow users=“<userList>” />

<deny users=“<userList>” />

</authorization>

Trang 30

<user name="User1" password="user1!"/>

<user name="User2" password="user2@"/>

<user name="User3" password="user3#"/>

Trang 31

 ASP.NET is a collection of all the ASP.NET pages, the custom

controls and modules

 It provides the configuration files to customize the web site.

 The ASP.NET configuration files are written in XML, which enables

the developer to modify them using an XML parser.

 Two types of configuration files exist in ASP.NET:

Machine.Config

Web.Config

 A hierarchical structure can be formed with every directory,

configuring the files present within them, with their own Web.Config files.

Trang 32

Summary Contd…

 Within the configuration tags, the configuration information is

grouped into two categories:

The configuration section handler declaration area

The configuration section settings area.

 The process of validating the user name and password is known as

Authentication

Ngày đăng: 15/11/2012, 14:44

Xem thêm

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN