ASP Web Application Quick Start for. NET (1)
What is ASP. NET Application?
ASP. NET defines an Application as follows: it is the sum of all files, pages, modules, and executable code in a virtual directory running on the Web Application server and its subdirectories. For example, an application called "order" may be a "/order" virtual directory of the Web server. The virtual directory can be accessed through the Internet.
Services Manager settings, which can contain any subdirectory.
Every ASP. NET application runs in a unique. NET runtime application domain, which ensures class isolation (no translation or naming conflict), security box (to prevent access to specific machines or network resources) and static variable isolation.
ASP. NET maintains an HttpApplication instance pool and automatically allocates one of these instances to process each HTTP request received by the Application. The assigned special HttpApplication instance is responsible for managing requests throughout the life cycle. It can be reused only when the request ends. This indicates that the user code does not need to be entered again.
Create Application
To create an ASP. NET Application, you can use an existing virtual directory or create a new virtual directory. For example
2000 on the server, there will probably be a directory C: InetPubWWWRoot; we use Internet Services Manager to configure IIS, at "Start
-> Programs-> Administrative Tools ", right-click an existing Directory, or select new to create a new virtual directory, or select Properties to promote an existing normal directory as a virtual directory.
Now let's take a look at how to trigger ASP. NET application. We can write a simple. aspx file, place it in a virtual directory, and access it in a browser. For ease of comparison, we listed the code written in three languages: VB, C #, and JScript:
C #
<% @ Page Language = "C #" %>
<Html>
<Body>
<H1> hello world, <% Response. Write (DateTime. Now. ToString (); %> </Body>
</Html>
VB
<% @ Page Language = "VB" %>
<Html>
<Body>
<H1> hello world, <% Response. Write (DateTime. Now. ToString () %> </Body>
</Html>
JScript
<% @ Page Language = "JScript" %>
<Html>
<Body>
<H1> hello world, <% Response. Write (DateTime. Now. ToString (); %> </Body>
</Html>
The code is simple, but the current time information is printed in the browser. We can add some code to use the Application object, such as saving the object as the application range type. By creating a global. asax file, we can also define various event handlers, such as Application_OnStart event triggers.