An Introduction to ASP.NET Web Programming - How static web pages work
(Page 3 of 4 )
Many of the web pages on the Internet are static web pages that don’t change in response to user input. These pages are HTML documents that are defined by HTML, or Hypertext Markup Language.
Figure 1-3 shows how a web server handles static web pages. The process begins when a user at a web browser requests a web page. This can occur when the user enters a web address, called a URL (Uniform Resource Locator), into the browser’s address box or when the user clicks a link that leads to another page.
In either case, the web browser uses HTTP to send an HTTP request to the web server. The HTTP request includes information such as the name and address of the web page being requested, the address of the browser making the request, and the address of the web server that will process the request.
When the web server receives an HTTP request from a browser, the server retrieves the requested HTML file from disk and sends the file back to the browser in the form of an HTTP response. The HTTP response includes the HTML document that the user requested along with the addresses of the browser and the web server.
When the browser receives the HTTP response, it formats and displays the HTML document. Then, the user can view the content. If the user requests another page, either by clicking a link or typing another web address in the browser’s address box, the process begins again.
Figure 1-3 also shows the components of a URL. The first component is the protocol, in this case, HTTP. In most cases, you can omit the protocol and HTTP is assumed.
The second component is the domain name, which identifies your web site. The URL in this figure, for example, includes the domain name for our web site, www.murach.com. The browser uses the domain name to identify the server that’s hosting the web site.
After the domain name, you specify the path where the file resides on the server. Notice that front slashes are used to separate the components of a path in a URL. After the path, you specify the name of the file you want to display in the browser. In this case, the file is a static web page named index.htm.
How a web server processes static web pages

The components of an HTTP URL

Description
A static web page is an HTML document that is the same each time it’s viewed. In other words, a static web page doesn’t change in response to user input. Everyone who views a static web page sees exactly the same content.
Static web pages are usually simple HTML files that are stored on the web server. When a browser requests a static web page, the web server retrieves the file from disk and sends it back to the browser. Static web pages usually have a file extension of .htm or .html.
A web browser requests a page from a web server by sending the server an HTTP message known as an HTTP request. The HTTP request includes, among other things, the name of the HTML file being requested and the Internet addresses of both the browser and the web server.
A user working with a browser can initiate an HTTP request in several ways. One way is to type the address of a web page, called a URL, or Uniform Resource Locator, into the browser’s address area and then press the Enter key. Another way is to click a link that refers to a web page.
A web server replies to an HTTP request by sending a message known as an HTTP response back to the browser. The HTTP response contains the addresses of the browser and the server as well as the HTML document that’s being returned.
Figure 1-3 How static web pages work
Next: How dynamic web pages work >>
More ASP.NET Articles
More By Murach Publishing
|
This article is excerpted from chapter one of Murach's ASP.NET 3.5 Web Programming with VB 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774472). Check it out today at your favorite bookstore. Buy this book now.
|
|