Click to See Complete Forum and Search --> : Virtual Directories with ASP.net


supafly
May 24th, 2007, 10:48 AM
Hi,

I've been looking for a long time to find how virtual directories are used to open asp.net pages but have not found the answer. Its a method which I'm sure is used on many websites but i've yet to find how its done. Here's an example. The following URL (i assume) is a virtual directory:

http://www.mingleville.com/MrMuscles

Yet when you follow the link, it goes so some kind of asp or php page. Does anyone know how this is done?

Thanks,
Rob

Shuja Ali
May 24th, 2007, 11:21 PM
If you open Internet Information Services, and select a Web Site under Default Web Site, you will find a Documents Tab. Under this tab, you have a check box Enable Default Document. By checking this checkbox you add file(s) that will be displayed when the user just types the name of the virtual folder.

supafly
May 25th, 2007, 03:38 AM
Thanks, how do you think that particular site works?

Am i right in thinking that there are is a generic profile displaying page and when you enter the that virtual directory, the profile name is passed into the page as parameters, so it displays the correct profile?

Shuja Ali
May 25th, 2007, 04:29 AM
Thanks, how do you think that particular site works?

Am i right in thinking that there are is a generic profile displaying page and when you enter the that virtual directory, the profile name is passed into the page as parameters, so it displays the correct profile?
How this particular site works is a different question. You will probably have to ask much more experienced ASP.NET programmer. I would wait for mcmcom to answer this question.

supafly
May 31st, 2007, 06:15 AM
bumpski, for anyone who knows...

mcmcom
May 31st, 2007, 10:18 AM
hi,

ok So you basically are asking to do the following.

1. Set up an iis site (with a Virtual Directory) that allows your applications main page to be accessed WITHOUT having to type it in to the address bar.

Example: http://www.mysite.com/myVirtualDir/ would be the same result as
http://www.mysite.com/myVirtualDir/Default.aspx

Well its quite easy actually.
1) If you create a Visual Studio Project and make your starting page named "Default.aspx" (as Visual Studio does by default) then you should not have to do ANYTHING for that to work.

2) If you did make it some weird name like "MyHomePage3.aspx" and you wanted THAT page to show when you just typed in "http://www.mysite.com/myVirtualDir/ " Then you do the following in IIS (Internet Information Server)

a) go to your virtual dir in IIS
b) right click PROPERTIES
c) go to the Documents Tab
d) ensure you CHECK "Enable Default Documents"
e) Press the ADD button
f) Add your Page to the box 'MyHomePage3.aspx'
g) You can move it up to the top of the list, or delete all the other one (it basically starts at the top looking for pages with that name and moves down the list if it can't find any)
h) Save it,
i) you may have to stop and re-start IIS but i dont think you do

thats it
you should be able to get to your home page by just typing in ADDRESS/VirtualDirectory

hth,
mcm

supafly
June 4th, 2007, 09:55 AM
Thank you very much

mcmcom
June 4th, 2007, 09:56 AM
rate me posts!

thanks,
mcm

TheCPUWizard
June 4th, 2007, 10:00 AM
g) You can move it up to the top of the list, or delete all the other one (it basically starts at the top looking for pages with that name and moves down the list if it can't find any)


Just wanted to highlight that is is a good idea to remove all entiries from the list that are not intended to be valid. It reduces the security exposure.

mcmcom
June 4th, 2007, 10:45 AM
yes agreed.

mcm