CompilationMode enumeration for the page tag in asp.net 2.0
Hi,

One of the new attribute of the page tag in Asp.Net 2.0 is the CompilationMode attribute. The attribute is used to specify whether the Asp.Net compiler should compile the page or not at the runtime. The attribute has been added new in the asp.net 2.0.

The attribute can have 3 possible values. Always, Auto and Never. The default value is Always. As the name suggest the always and never value are used to tell the compiler to compile the page always or never respectively. Auto value means that Asp.Net will only compile the page if required.

Setting a page to never compile using the Never attribute will increase performance by disqualifying the specified page in the compilation process. Here is how we set the attribute for a particular page.
<%@ page compilationMode=”never” %>

You can also set the compilationmode property in the web.config file for all the pages.
<system.web> 
    <pages page compilationMode=”Auto”

[Note: If the CompilationMode is set to Never and 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.]

Vikram

Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2008 Vikram Lakhotia