Search code examples
c#asp.netclrexecutionpage-lifecycle

How does an aspx page is execute?


Possible Duplicate:
What is the 'page lifecycle' of an ASP.NET WebForm?

I have studied a lot of article on execution process in .net. What i found is that

Language code(C#,vb, j# etc.) ----> language compiler ---> MSIL code -----> now this MSIL code is processed by just-in-time which is inside CLR

this process is okay for class library execution or windows app or console app but in asp.net we have a .aspx page + a code behind (c#, vb etc.)...In that case how this execution process takes place ?


Solution

  • ASP.NET will process your ASPX and code-behind file like this:

    1. Load ASPX from disk
    2. Parse ASPX code into a code-dom that can be edited through extensibility hooks
    3. Save that code into a C# file on disk
    4. Use csc.exe to compile this code into an assembly. Everything in your /bin folder will be available as a reference.
    5. Load the assembly.
    6. Load all bin assemblies.
    7. Invoke the rendering code inside the freshly compiled assembly. This will start the usual process of JITing and executing.