The difference between a web application and web site

Introduction:
recently learned a lot of basic knowledge related to web programming, will take over a series of comparative learning the basics of today's briefly look at the difference between web applications and web site!
Here Insert Picture Description
1, the compiler is not the same
this is the biggest difference between the two I think, first of all, all of the files in the web application are independent of each other, that I changed a file, or an error will not affect other interface! But the web site is not the same, it is one of the files in the code is wrong, then the whole system will pop up an error! Such a phenomenon occurs because the compiler is not the same as the way between them, web sites in which you use a file, which files to compile our systems go! The web application that is to call us no matter which file, our system will compile all the files, so, according to a file will be compiled, if there is wrong, then it must be found! So are web applications, do a small site at the time when we do large-scale software we generally choose, we generally use web site!

2, modify the code when the file update different
site each page (aspx, ashx) generates a corresponding assembly, the name is random, when a file is saved establishment, the request will automatically save it. If you change the file code, Assembly.GetExecutingAssembly (). Location
will be re-compiled to generate a new assembly, if not changed, will not generate a new one. (A general processing procedure in a Web site acquired the current general processing files generated dll file. If the general handler code changes so regenerate, no change will not be rebuilt.
)
where the Web application must be modified to re-generate the code later, or modified the code does not generate the assembly, the assembly may or old content

3, web site no namespace
why the site does not need a namespace? Namespace is the situation for area classification of the same name, and the site a document is a stand-alone program, so the situation does not appear like the same name.

4, web site App_Code
now know that the site is a separate file for each program, independently of each other, and if so then if our code reuse great inconvenience, because of things like this can not be public SqlHelper calls, connect to the database calls to the database would not be trouble is dead! This would not have to worry about, because Microsoft provides a App_Code for the site, we can put all that common code in App_Code to solve the problem!

Postscript:
So finally sum it up: large sites more suitable for use WebApplication (application) project, more suitable for small site with WebSite (website) project! Some people may ask not to remember the last words, and I would like to say that we want to know why!
----------------
Disclaimer: This article is CSDN blogger "light handsome brother _" in the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/jerry11112/article/details/84574181

Original articles published 0 · won praise 0 · Views 13

Guess you like

Origin blog.csdn.net/tuoai9113/article/details/104826861