Differences and connections between .aspx(or .asp; and .html(.htm) files

Source: Internet
Author: User


Because they are all files used to describe web files, I was curious about the relationship between them since I learned Asp.net.

The main difference is that when a user requests a page, they are processed differently on the server side.

The server processes the client request page as follows:


. Html file

Ø. html files are HTML-Based Static webpages and their content remains unchanged. The content of the page only uses standard HTML code, with the most popular animated images in GIF, Flash, and other formats added, as well as animated effects such as dynamic subtitles.

When the client requests webpage content from the Web server through the IE browser, the server only transmits the static HTML document that has been designed to the user's browser.

. Aspx File

. Aspx is the extension of ASP. NET pages. It is nothing more than embedding dynamic commands in Static HTML pages (these dynamic commands are compiled by various scripting languages and executed by the script engine on the IIS server. If the browser requests an ASP. NET page, before sending the result back to the browser, the server will first process the executable code on the page (that is, the script language code ).

That is to say, an ASP Webpage consists of two parts:

(1) HTML static webpage elements: interpreted and executed by IE

(2) ASP script command: interpreted and executed by the IIS Script Engine


Comparison 1:


We insert the script language on the HTML page and the ASPX page respectively to compare the running effect.

HTML testing:



Aspx test:




The elements of Static HTML language define how data is displayed, rather than how data is dynamically generated. Therefore, web pages created simply using HTML are static.


Comparison 2:

On the page corresponding to the browser, right-click and choose View Source Code (hereinafter referred toClient source code).Client source codeSource Code Compiled with server programmers (hereinafter referred to as serverServer Source Code) Are they consistent?


HTML testing:


Aspx test:



The Web server directly sends the request to the browser without processing the static html page. Then, the browser interpreter interprets the content and displays the result. In fact, for static websites (websites composed of Static HTML pages), Web servers are indeed not necessary. Here, the web server does not act as the organizer of a static webpage.


1. Although ASP Web pages and static Web pages are both text files, only files suffixed with ASP in IIS are considered as ASP dynamic web pages, which are handed over to the script engine for execution.

2. You can see that the static web page can use ASP as the extension, but you do not agree with this. As soon as the extension is changed, the execution mechanism in the background will change, which will lead to a decline in server performance.

3. web pages with the extension aspx (or ASP) will be handed over to the script engine for identification and execution. The script engine determines whether the webpage code is dynamic or static line by line. If it is static, it is directly fed back to IE. If it is dynamic aspx (or ASP) Code, the result is generated as required and the result is inserted to the relevant location on the webpage, finally, report it to IE.

4. asp contains an ASP. dll file, which is installed in the system directory winnt \ system32 \ inetsrv \ by default.

5. This file is a dynamic link library, which is used to analyze web files suffixed with ASP and determine whether ASP dynamic script code exists. If yes, the code is sent to the corresponding Script Engine for execution. If it is static HTML code, it is directly fed back to IE browser.


6. Generally, this is not required, because IIS already has a script engine embedded with VBScript and JavaScript. If you need to develop web pages for other types of script commands, you need to install the corresponding Script Engine

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.