Virtual directory
How can i create a virtual directory in ASP.NET?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anuja PawarPosted Dec 20, 2011, 2:22 AM
When a virtual directory is defined in Internet Service Manager, an alias is associated with the virtual directory. The alias is the name that will be used by clients to access information in the virtual directory. If alias names for virtual directories are not specified by the administrator, an alias name is generated automatically by Internet Service Manager.
Create Virtual Directories in IIS 4.0
1. Click Start, point to Programs, click to select Windows NT 4.0 Option Pack, point to Microsoft Internet Information Server, and then click Internet Service Manager.
NOTE: For these steps, do not click Internet Service Manager (HTML).
2. Expand Internet Information Server.
3. Expand the server name.
4. In the left pane, right-click Default Web Site, point to New, and then click Virtual Directory.
5. In the first screen of the New Virtual Directory Wizard, type an alias, or name, for the virtual directory (such as MyWebData), and then click Next.
6. In the second screen, click Browse. Locate the content folder that you created to hold the Web content. Click Next.
7. In the third screen, click to select Read and Run scripts (such as ASP). Make sure that the other check boxes are cleared. Click Finish to complete the wizard.
8. For ASP content, you may want to confirm that an application was created. To do this, right-click the new virtual directory, and then click Properties.
9. Click Virtual Directory and make sure that the virtual directory name is listed in the Application Name box under Application Settings. If it is not, click Create.
10. Close the Properties dialog box, and then close IIS.
You can create an almost unlimited number of virtual directories for your service, although performance may suffer if you create too many of them.
To locate virtual directories, the URL for the virtual directory must be specified. You can do this by either clicking a hypertext link that contains the URL or by typing the URL in the browser. For the gopher service, you can create explicit links in tag files so that users can access virtual directories. For the FTP service, you can list virtual directories by using directory annotations or by creating a subfolder with the same name as the virtual directory.
Satyapriya NayakPosted Dec 19, 2011, 8:13 AM
A virtual directory represents a web application and it points to a physical folder in your computer.
A web application is accessed using a virtual directory name instead of a physical folder name. For example, if you have a web application called "Shopcart" in your machine, you will have a virtual directory for this web application. You will access your web application using the URL httP://localhost/Shopcart. If your virtaul directory name is "Test", then your web application url will be "http://localhost/Test".
Assume you have a web application called "Shopcart", created under the physical folder "C:\MyProjects\Shopcart".
You can go to IIS and see this virtual directory listed. Right click on this virtual directory name in IIS and see the properties. You can see that this virtual directory is pointing to the physical location "C:\MyProjects\Shopcart".
If you have a file called "File1.aspx" under the folder "C:\MyProjects\Shopcart\", then you can access this file using Internet Explorer with the URL "http://localhost/Shopcart/File1.aspx"
How to create a virtual directory ?
When you create a new web project using, a new virtual directory will be created automatically for you. This virtual directory will point to a new folder created under C:\Inetpub\wwwroot.
If you like to better organize your projects and files in your favourite folder, you must manually create a new folder for each project in your preferred location and convert it into a virtual folder manually.
There are couple of ways you can do this.
Method 1: Open the IIS. Right click on the node "Default Web Site" and select "new Virtual Directory". When it prompt you to enter the "alias", enter the virtual directory name you want(Eg: Shopcart). In the prompt for "directory", select the folder which you want to make a virtual directory (Eg: C:\MyProjects\Shopcart). Select other default values and press "Finish". Now you should be able to see your new virtual directory in IIS.
Method 2: In the explorer, go to the folder(Eg: C:\MyProjects\Shopcart) which you want to make a "virtual directory". Right click on the folder name and select "Properties". Select the tab "Web sharing" and select teh option "Share this folder". It will prompt you with a default Alias name same as the folder name (Eg: Shopcart). Simply select the default values and press "OK".
Please refer the below link
http://www.dotnetspider.com/AspNet-Tutorial-86.aspx
http://www.startvbdotnet.com/aspsite/extras/virtualdirectory.aspx
Thanks
Sai PrakashPosted Dec 19, 2011, 4:19 AM
find the below link................ http://r4r.co.in/asp.net/01/tutorial/asp.net/what_is_virtual_directory.shtml
http://r4r.co.in/asp.net/01/tutorial/asp.net/what_is_virtual_directory.shtml