IIS Virtual Directory on-the-fly

J

John Haycock

Hi All

I've managed to create a virtual directory on the fly but I want it to
redirect to a url.

If you are doing it manually you just go to the properties of the folder
click on the "redirection to a url" radio button and then type the url you
want it to point at in the textbox.

Is there a way to set this up in code. You can set other properties like:
oVirDir.Properties["AccessRead"][0] = true;

oVirDir.Properties["AccessExecute"][0] = true;

Does anyone know of a property to redirect to a url?

Thanks in advance

John
 
G

Guest

Hi All

I've managed to create a virtual directory on the fly but I want it to
redirect to a url.

If you are doing it manually you just go to the properties of the folder
click on the "redirection to a url" radio button and then type the url you
want it to point at in the textbox.

Is there a way to set this up in code. You can set other properties like:
oVirDir.Properties["AccessRead"][0] = true;

oVirDir.Properties["AccessExecute"][0] = true;

Does anyone know of a property to redirect to a url?

Thanks in advance

John

HttpRedirect
http://msdn.microsoft.com/library/d...html/5e429d06-1735-4db4-842f-c32c2edbc25e.asp
 
T

Thomas Hansen

Hi All

I've managed to create a virtual directory on the fly but I want it to
redirect to a url.

Sounds like what you WANT to do is to create an IHttpHandler...
Look it up :)
 
J

JPH

Are you suggesting URL rewriting?

I was hoping to avoid that.

Cheers

John

I sussed it out. I knew there must be a property to do this but
finding it was a mare

Once you create your virtual directory you redirect it like this:

oVirDir.Properties["httpredirect"][0] = "http://localhost/website/
project.aspx?projectID=217";

Cheers for your help fellas

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top