Web Studyaspnet.blogspot.com Babyneed.blogspot.com

ASP.Net Web Developer Guide

Power By: eXTReMe Tracker Powered by Blogger  
 
 
 
 

 

 
Important Links
 
   
     
 
Sitemap
 
   
   
 
Reference
 
   

Thursday, January 26, 2006

How Web Servers Execute ASP Files (Chapter 1)

When a site visitor requests a Web page address, the browser contacts the Web server specified in the address URL and makes a request for the page by formulating a HTTP request, which is sent to the Web server. The Web server on receiving the request determines the file type requested and passes processing to the appropriate handler.ASP.NET files are compiled, if necessary, into .NET Page classes and then executed, with the results sent to the client’s browser.
Compilation means that on first load ASP.NET applications take longer to display than previous versions of ASP, but once compiled they are noticeably faster.
Client-Server Interaction
ASP.NET applications are a mixture of client side markup and code, and server side processing. When an ASP.NET Web form page is downloaded to the visitor’s Web browser, additional code is included to previous ASP versions. This extra code enables richer form functionality, including server and client side events, validation, and the ability to maintain form value state. The server determines the visitor’s browser type and sends markup to match the browser’s abilities.
Some client interactions will be dealt with within the visitor’s browser, while others will require information to be posted to the server for processing and the altered page returned.
As form responses are received, the form values are maintained in a new facility of ASP.NET “State Bags” and are compressed into a hidden form element containing the page “Viewstate.” This allows the form elements that the visitor has interacted with to maintain the same values as when the page was submitted. As illustrated in Figure 1.1, the browser can request information from and send information to the server using two HTTP methods, GET and POST.


GET is simply the method in which the browser compiles a URL.A typical URL in this context will consist of a protocol, for example, HTTP for hypertext or FTP for file transfer, a fully qualified domain name, such as http://www.aspalliance.com,/ followed by a path, such as “/chrisg/”, and then the page to GET, such as “default.asp” or “index.html.” You can add information as parameters, called a querystring. This is separated from the rest of the URL with a question mark, and the parameters take the form of keywords and values such as “keyword=value,” for example ,“article=5.” Multiple parameters are separated with ampersands, so if we have two parameters, foo and bar, they would be presented like foo=a&bar=z. So, a full GET request including querystring could be http://www.abcxyz123.com/site/index.asp?page=5.
When a browser sends information using the POST method, the parameters are compiled in the same way but sent separately in the HTTP header, and so are not seen in the URL portion of the browser like GET requests are. Forms often use POST for this very reason.
Other information goes into the HTTP request header, such as what browser the user is using and so on. As you will see later, your ASP can pick up this header information and the querystring parameter values.

0 Comments:

Post a Comment

<< Home