This article is about the special "reserved" folders that are used in an ASP.NET project, such as App_Code or App_Data. Each one is discussed in details, with suggested uses for it.
Note that your ASP.NET project may or may not contain these directories. They are optional, and the uses given by Microsoft are only suggested uses. You are free to use them or not use them, for any purpose you like.
If you want to add one of these folders, go to Solution Explorer and right-click on your project's name at the top of the list. Select "Add ASP.NET folder" and pick the one(s) you want to add.
App_Data can be used to store datafiles such as databases that are used by this application. One common use is as a location to store the ASPNETDB.MDF file that is used to store usernames and passwords for authenticated website access.
App_Code is typically used to store .cs or .vb files that contain classes that are needed by your main code. Any file you put in here is automatically referenced in your main application, which is very handy. I put libraries of useful functions wrapped up in a static class here, and the compiler automatically picks them up and uses them.
App_Browsers stores special config files for individual browsers' settings. I've never needed to use this, but if you are writing code to target many unusual browsers, perhaps you could find a use for it.
App_GlobalResources is used to store .resx and .resources files, such as files for translation of your website into different languages. These files apply to the entire project.
App_LocalResources is a reserved folder name that is like App_GlobalResources, except that you can have more than one of them, in any folder in your application. It acts like a local version of App_GlobalResources that only applies to that particular folder.
App_Themes is a folder used to store any files that change the appearance of the website, such as .css files, .skin files, or images that are used in a certain theme.
Bin is the folder to put .dll files in if you want your whole application to have access to the dll file. Anything you put here, such as a third-part control, is available to your whole application.
App_WebReferences is a mystery folder that I don't understand yet!
No comments:
Post a Comment