Geeks With Blogs
Shravan's Articles on .NET A .NET Blog

When we creates a page in ASP.NET internally it create a .NET class. i.e: An instance of System.Web.UI.Page class. All the content in ASP.NET page including scripts,HTML content and plain text is compiled into .NET class.

When a client request for ASP.NET page then ASP.NET Framework searches for a .NET class corresponding to the page then executes the class.If the class is not found then it compiles the page into new .NET class and stores the class into temporary ASP.NET folder in the following location.

in .NET Framework 4.0 beta 2
"\Windows\Microsoft.NET\Framework\v4.0.21006\Temporary ASP.NET Files"

up to .NET Framework 3.5
"\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"

If anyone request for same page next time again page is not complied. The corresponding class will be executed. Until unless the page is not compiled again the source code is modified.This process is called "Dynamic Compilation".

When the page is compiled into class then there is a dependency is created between the ASP.NET page & .NET class. If the source code of the page is modified corresponding .NET class will be deleted.If user next time request the page then it will compiled into new .NET class. Unlike classical ASP application the pages are not compiled every time when the user requests.

We have option to precompile an entire ASP.NET application using aspnet_compiler.exe command line tool.If we precompile an application ,user doesn't experience the compilation delay for first page request.

How to disable dynamic compilation ?

We have attribute "CompilationMode" if we use this with <%@Page%> directive we can disable the dynamic compilation for a page. If we use this in tag in web.config we can disable for pages in a folder or even for complete application.

Posted on Saturday, December 26, 2009 11:32 PM ASP.NET | Back to top

Copyright © Shravan Kumar | Powered by: GeeksWithBlogs.net