title: How is a web application started? Where is the entry point (if there's one)?
body: <p>I am using IIS to develop some web applications. I used to believe that every application should have a entry point. But it seems a web application doesn't have one. </p>
  
  <p>I have read many books and articles addressing how to build an ASP.NET application under IIS, but they are just not addressing the most obvious and basic thing that I want to know.</p>
  
  <p>So could anyone tell me how is a web application started? What's the difference between a traditional desktop application and a web application in terms of their working paradigm, such as the starting and terminating logic.</p>
  
  <p>Many thanks.</p>
  
  <h2>Update - 1 - 23:14 2011/1/4</h2>
  
  <p>My current understanding is:</p>
  
  <p>When some request arrives, the URL contained in the request will be extracted by the IIS. I guess IIS must have maintained some kind of a internal table which maps a URL to corresponding physical directory on disk. Let's take the following URL as an example:</p>
  
  <pre><code>http://myhost/webapp/page1.aspx
  </code></pre>
  
  <p>With the help of the aforementioned internal table, IIS will locate the <em>page1.aspx</em> file on disk. And then this file is checked and the code-behind code file is located. And then proper page class instance will be contructed and its methods defined in the code-behind file will be invoked in a pre-defined order. The output of the series of method invoking will be the response sent to the client.</p>
  
  <h2>Update - 2 - 23:32 2011/1/4</h2>
  
  <p>The URL is nothing but <strong><em>an identifier that serves as an index into the aforementioned internal table</em></strong>. With this index, IIS (or any kind of web server technology) could find the physical location of the resource. Then with some hint (such as file extension name like *.aspx), the web server knows what handler (such as the asp.net ISAPI handler) should be used to process that resource. That chosen handler will know how to parse and execute the resource file.</p>
  
  <p>So this also explains why a web server should be extensible.</p>