Friday, March 04, 2005

ASP.NET 2.0

I have been working with ASP.NET 2.0 Master Page feature. It is pretty easy too work with. After getting a simple one to work (one master and one content page), I assumed that the architecture underneath was based on inheritance, sort of like Inherited Windows Forms. Well, after some research and experimentation I found that this feature is not based on inheritance as is Windows Forms; instead it uses a merge technique.

Actually what seems to happen is that a master page is compiled to its own dll, content pages that use the master page are compiled to their own dlls. A merge process takes place to contruct the final page that is ultimately sent back to the browser. No matter how many content pages reference a particular master, there is only one dll for that master.

A lot of this can been seen by constructing a simple example (one master and two content pages that reference the master), then run one of the content pages with debugging. The code for each page, master and content, can then be found in C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files. You can see the actual code (VB or C#) generated. Also, you can use ILDASM to look at the dlls that are generated.

0 Comments:

Post a Comment

<< Home