ASP.net learning Notes II establish ASP.NET application __.net

Source: Internet
Author: User
Tags configuration settings parent directory

ASP.net learning notes the second set up the ASP.net application

First, ASP. NET configuration file Features

1 The configuration information is stored in an xml-based text file.

2 Multiple profiles (names are web.config) can appear in multiple directories on the asp.net Web application server. Each Web.config file applies the configuration settings to its own directory and to all subdirectories below it. A configuration file in a subdirectory can provide configuration information other than the configuration information inherited from the parent directory, and the subdirectory configuration settings can override or modify the settings defined in the parent directory.

The root configuration file named Systemroot/microsoft.net/framework/versionnumber/config/machine.config provides the ASP.net configuration settings for the entire WEB server.

3 at run time, ASP.net calculates a set of configuration settings for each unique URL resource using the configuration information provided by the Web.config file in the hierarchical virtual directory structure. The result configuration settings are then cached for use by all subsequent requests for resources. Note that inheritance is defined by the incoming request path (URL), not by the file system path (physical path) of the resource on disk.

4) ASP.net detects changes to the configuration file and automatically applies the new configuration settings to Web resources that are affected by the change. You do not need to restart the server for the changes to take effect. Hierarchical configuration settings are automatically recalculated and cached as long as the configuration files in the hierarchy are changed. Exceptions to the <processModel> section.

5) The ASP.net configuration system can be extended. You can define new configuration parameters and write configuration section handlers to process them. dynamically changing configuration.

6) ASP.net protects profiles from external access by configuring Internet Information Services (IIS) to prevent direct browser access to configuration files. Returns HTTP access error 403 (forbidden) to any browser that attempts to request a configuration file directly.

Second, asp.net configuration file format
1) naming

Mark or attribute Camel case Form AppSettings
Attribute value Pascal Case form such as AppSettings

2) format

A) All configuration information between:<configuration> and </configuration>

B contains two primary zones: Configuration section Handler declaration area and Configuration section Settings area

C) configuration section Handler declaration area:,<section> between the top <configSections> and </configSections> tags of the configuration file Each declaration in a tag provides a section name for a particular dataset and the underlying class name that processes the dataset.

D The configuration section Settings area is located after configsections contains the actual configuration settings

E put the configured files in the server's root machine.config file or in the Web.config file of the virtual directory that contains the WEB application files. The configuration file in the subdirectory automatically inherits the configuration handlers declared in the parent directory.

F) asp.net setup schema

<configuration>
<location>
<system.web>
<authentication>
<forms>
<credentials>
<passport>
<authorization>
<allow>
<deny>
<browserCaps>
<result>
<use>
<filter>
<case>
<clientTarget>
<add>
<remove>
<clear>
<compilation>
<compilers>
<compiler>
<assemblies>
<add>
<remove>
<clear>
<customErrors>
<error>
<globalization>
<add>
<remove>
<clear>
<add>
<remove>
<clear>
<identity>
<machineKey>
<pages>
<processModel>
<securityPolicy>
<trustLevel>
<sessionState>
<trace>
<trust>
<webServices>
<protocols>
<add>
<remove>
<clear>
<serviceDescriptionFormatExtensionTypes>
<add>
<remove>
<clear>
<soapExtensionTypes>
<add>
<clear>
<soapExtensionReflectorTypes>
<add>
<clear>
<soapExtensionImporterTypes>
<add>
<clear>
<WsdlHelpGenerator>
</webServices>
</system.web>
</location>
</configuration>

Third, asp.net Web application directory structure

1) Building the directory structure

C:/mywebapp
Default.aspx
Menu.ascx
Service.asmx
Web.config
Global.asax
/bin the DLL used to place the application
MyBizLogic.dll
/img
Myimage.gif

2 In addition, if you write any application-scoped functions, including handlers for the Application_Error event, you should place them in the Global.asax file.

3 Deployment of ASP.net applications is simple. Simply copy the application files you created from the development computer to the production Web server that will host the application.

4 to deploy assemblies that you want to share between WEB applications, such as the assemblies that contain custom ASP.net server controls, you should deploy them to the global assembly cache.

5) asp.net structure

Web Client

|

asp.net applications <-> IIS

| |
|
. NET Framework |
|
| |

Windows nt/2000 Operating System

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.