ASP Web Application Quick Start for. NET (1)

Source: Internet
Author: User
Tags what is asp

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.


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.