The Visual Studio project system allows you to define a new Web Site project based on how you intend to access the site content from a web server.
You can create a Web project connected to a File system based on your computer, an IIS server or an FTP server. This helps in how you run, manage and deploy your Web site project.
Following are the location of your Web project:
- File system
- HTTP
- FTP
File System
The File System option creates the new website in a location on your hard drive or on your shared network drive. Using such a file system Web site means that you do not need to create your site as an Internet Information Services (IIS) application to develop or test it.
.NET 2.0 onward versions Microsoft launched ASP.NET Development Server with .NET Framework which work as an attached process when any Web Application executes. ASP.NET Development Server comes along with .NET
In ASP.NET Development Server instance is created as attached process in File System.
File systems Web sites are particularly useful in the following situations:
- When you do not want to (or cannot) install IIS on your development computer.
- When you already have a set of Web files in a folder, and you want to use Visual Web Developer to open them as a project.
- In classroom settings, where students can store files on student-specific folders on a central server.
- In a team setting, where team members can access a common Web site on a central server.
File System is used till the process of development, after development it is used in FTP/HTTP server.
HTTP
An HTTP based Web site is used when you are working with a site deployed inside of IIS (either locally or on a remote server). This Web site may be configured at the root of the IIS Web server or in a virtual directory that is configured as an application.
Note: A remote server running IIS will have to provide access to your Web files using Front page Server extension.
In this application will be created under IIS (Internet Information Services) server.
In HTTP your web application is stored under IIS home directory. You will not get any instance of ASP.NET Development server. No port is specified. The request will be handled at IIS port only.
Creating or opening a local IIS Web site is useful in the following situations:
- You want to test your Web site using IIS, which closely emulates how the Web site will run on a production server. This can have advantages over working with file system Web sites that run using the ASP.NET Development Server, because paths are resolved as they will be on a production server.
- You already have a set of Web site files in a folder and you want to test the Web site with IIS. In this case, you can create a virtual directory in your local version of IIS.
- Your local computer is also your Web server.
You can create file system of your choice but you have to map with IIS server. We map with the help of Virtual Directory.
How to create a virtual directory?
Follow the steps given below:
Step 1: Run the inetmgr from taskbar - >run
Step 2: Right click on Default Web Site and click on New -> Virtual Directory
Step 3: Click on Next Button
Step 4: Give a name of you choice to your virtual directory.
Step 5: Select the physical path on your hard disk or sharable network drive.
Step 6: Check the permission you want to set for the Virtual Directory.
Step 7: Click on Finish. You are done.
FTP
FTP location provides direct facility of creating application at FTP.
The FTP based Web site is useful when you want to connect to your web site via FTP to manage your files on a remote server. This option is typically used when your website is hosted on a remote server computer and your access to the files and folders on that server is through FTP.
Selecting FTP is essentially the same but creates the site on a server that is accessed using the FTP (File Transfer Protocol).
In FTP your application work on two modes – debug mode and release mode.
Choosing HTTP or FTP generally requires that you have a username and password for a location on a server provided by a web host.
FTP by default is not secure. When a user login to a server his/her information is sent as plain text.
There is more information about FTP and FTP Active Mode and Passive Model, which I have not mentioned here.
Conclusion
I hope that this article would have helped you in understanding creating websites in ASP.NET. Your feedback and constructive contributions are welcome.