Wednesday, December 29, 2010

"CompilationMode" attribute in Page website allow developer to configure whether page is compile or page directive
<%@ Page Language="C#" CompilationMode="Never" %>
The attribute can have 3 possible values.
Always: This is default value the name is suggest that page is compile alway this is not good for  scalability of website.
Never : This name suggest the page is never compile means It will also prevent compilation to an assembly,If a page contains a script block or code construct that requires compilation, ASP.NET will return with an error and the page will not run.
Auto : value means that Asp.Net will only compile the page if required.
set this attribute in your wesite The main benefit is scalability.  In large web sites, this can avoid the need to compile high number of pages into assemblies.  Instead of compiling, these "no-compile" pages are processed by it's corresponding control builder which is preserved in memory for the life of the application.
if you want to apply this to an already existing web application it’s much easier to set the CompilationMode to Auto in the web.config depending on the size of the web application.
<pages compilationMode="Auto">

Hope it will help you,Thank You for your time to reading,

Kirti M. Darji