![]() |
B
efore we actually start on creating websites using ASP.NET, you must first know what's happening behind the scenes. In the real world, when you want your website to be accessible by the world, you need to host it to a server. When someone with a browser request for a page on your website, they will type the domain name of your website. The domain name is what identifies your site. Every domain name has a mapped IP address. Consider the IP address as the address of your house. It determines where the server is located. When you are accessing the page, you are typing a URL (Unified Resource Locator). The URL is composed of the protocol to use for communicating to the server, the domain name, and the path in the server's file system where the web page or file to be requested resides.
When the user types a URL, he or she expects a web page to be displayed. Web pages are created using the Hypertext Markup Language (HTML). An ASP.NET web page uses HTML but the components it uses such as server controls are not recognizable by a web browser. Therefore, an ASP.NET web page must be compiled first to an HTML page.
When the user requests a file from the server, the server will choose the necessary actions to respond to the request. For static files such as an HTML file, a text file or an image, the server simply sends those files to the browser and then the browser displays it. The case is different for dynamic pages. Dynamic pages are those whose contents are not predetermined and the server needs some sort of processing to generate the output that will be sent to the requester. ASP.NET pages are dynamic pages. An example of this is the page that we created in the previous lesson. When the page is initially sent to us, the message is not visible. When we clicked the button, the code we wrote for that page is executed in the server and it creates a new version of the page which includes the message. ASP.NET pages ends with .aspx extension. Using the concept called Application Mapping or Handler Mapping, an application can be mapped to the .aspx extension. This mapped application is the one that will process the mapped file extension. For .aspx pages, the ASP.NET runtime is used. The ASP.NET runtime is part of the .NET Framework. Based on the details of a .aspx page such as server controls and programming logic, the ASP.NET runtime can generate the valid HTML that will be sent to and finally viewed by the user that requests it. The server cannot simply just send an unprocessed or raw .aspx page because the browsers cannot recognize the code and server controls of it and they will not be displayed to the user.
when the user requests a URL from the browser used by your computer, it locates the server based on the domain name (example.com) which is mapped to an IP address. The IP address is the actual location of the server. Once it finds the server, it searches its files for the file being requested by the user, in the case of Figure 1, welcome.aspx. The server will then check the file extension of the file being requested and through Application Mapping, hands it over to the ASP.NET Runtime. The ASP.NET Runtime executes the C# or .NET code for that page and converts the ASP.NET server controls into valid HTML codes. Once the HTML page has been generated, the server will send the converted page back to the user that requests for that page.
Visual Web Developer comes with ASP.NET Development Server which allows you to run websites in your computer without uploading them to a real server. So basically, it makes your local computer the server that the browser will communicate. This is a great tool because deploying your website to a real web server is not free. When you are developing, you can simply just use the development server for testing purposes and then deploy it to a real server once you are ready.
Share this article with your friends
Share this article with your friends
Post A Comment:
0 comments: