Hi ASP Gurus,
I am about to write some asp pages, but got confused to pick between
Web Site or Web Application.
Can someone please explain some major differences between these two.
I'll appreciate any help/suggestion/advice I get on this topic.
I will take a different direction from what sloan has taken, although I
do love this site. ;-)
http://snurl.com/nb453
In general, use the web application template.
In early 2.0 (and perhaps beyond), the only exception I know of is when
you want to use custom Profiles, as you can end up having to rebuild the
Profile when you use a web application template. It was not a huge
thing, once you learned how to manually clear out your ASP.NET temporary
directory (often including rebooting IIS), but it was a major pain. Not
sure if it is fixed or not, but since I use custom Profile providers, I
don't really care (when I use profile at all).
On the converse side, if you are adding custom classes, the web site
template can give you some heartache.
In general, the difference is that one compiles and the other does not.
If you like to change a single page on the fly, it is "easier" with a
web app template. As an xcopy deploy does not take but a few seconds, it
is not a major benefit for me.
One benefit to web site is mixing code, but this is not as much of a
benefit any more, as you can do it in both (on the page level). If you
like to have one page in VB, one in C#, another in J# and another in
C++, then you will love this feature. If you are "normal", this is
probably not something you will cherish.
The pain with the web site is when you put code in app_code and try to
use it, but I am personally against putting anything in app code, as
application code should not be placed in the UI ... NEVER. Okay, maybe
not NEVER, as some might not want to build a separate WEB.UI library.
;-)
With a web application, you can deploy everything as assemblies. Not
completely true, as .NET will build pointer files with an @ Page
directive pointing to the entry point in the compiled code. This means
you can obfuscate your web app and not give away it's secrets. This is
really only a measure when you build a web app for someone who is
licensing the code, which is rare, but it is kewl none-the-less, even if
it is hardly practical for most of us.
In summary
1. Web site - page compiled on fly
2. Web app - application compiled
Oversimplification, but it works here.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************