Friday, July 31, 2009

Web site vs Web Application

visual studio 2003 : Introduced Web Application model .
Note :It has static Compilation

Visual studio 2005 : Introduced WebSite project type was introduced .
Note :
  • It contains both web Application Model and webSite model.
Visual studio 2008 : Supports both types of project

Web Site model and Web Application

  • And is based on folder model .After SP1 project file was introduced in visual studio 2005.
  • WebApplication project is more structured than web site project.
  • Class file shuuld be placed inside the App_Code.
  • Web Application project type is restricted to one language .Where as web site supports multiple languages,Because web site is compiled dynamically.
  • web site supports multiple lanuages files ,but those files need to be in the same folder .So the changes required in the webconfig.
E.g:



  • When deploy web Applicaton you can just copy the compiled elements and visual elements to the iis folder..Where as website we need to copy everything to the iis to work.
  • Code behind pages was introduced in visual studio 2005.Where we can create both the files(with code behind and with out code behind paes)
  • Partial class was also introduced in visual studio 2005
Dynamic compilation in Website

When you sent a request for a ASP.Net page,Frame work checks for the corresponding page and if the class is not exists ,Frame work compiles the page into a new .Net class and the stored the compiled class into the temporary ASP.Net folder located at

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

In future if a request comes to the same page ,the page is not compiled again .The previously compiled class is executed and returns to the browser.This process is called ASP.Net dynamic compilation.
If Asp.Net page is modified corresponding to .Net class is automatically deleted and when a new request comes for that page it compiles the modified page into a new .Net class.

To change compiled in Web site are as follows as

  • change the compilation mode using the page
E.g:




  • To change compilation mode using webconfig
E.g :



0 comments:

 
Counter