Popular Posts

Friday, March 11, 2011

Behind the scenes of a ASP.NET code

What exactly happens when an ASP.NET receives a request for the Codename.aspx

First the request for the page is sent to the web server.If you're running a live site ,the web server is almost certainly IIS.

IF YOUR RUNNING THE PAGE IN VISUAL STUDIO:
The request is sent to the built in Visual Studio's test server.

2.The web server determines the .aspx extension is registered with ASP.NET and passes it to the ASP.NET worker process.If the file extension belonged to another service(as it would for .asp or .html files),ASP.NET would never get evolved.

3.If this is the first time the page in this application has been requested,ASP.NET automatically creates the application domain .It also compiles all the web page code for optimum performance ,and caches the compiled files in the directory C:\Windows\Microsoft.NET\framework\v2.0.570727\Temporary ASP.NET files.If this task has already been performed ,ASP.NET will reuse the compiled version of the page.

4.The compiled Codename.aspx page acts like a miniature program.It starts firing events(most probably in the
Page.Load event).However,you haven't created an event handler for the event,so no code returns.At this stage,everything is working together as a set of in-memory .NET objects

5.When the code is finished,ASP.NET asks every control in the web page to render itself into the corresponding HTML markup.

6.The final page is sent to the user,and the application ends.

No comments:

Post a Comment