Saturday, March 31, 2012

Silly question I think

I have a web site with 2 virtual directories :

In one of the pages in one of the virtual directories (for ex vdir1) I need to POST to another page in the other virtual directory (for ex vdir2).

I did this with the WebClient class and it works fine - it's just I have to hardcode the whole URL of the other virtual directory - (exhttp://www.mysite.com/vdir2/test.aspx). I was wondering if I could avoid this since the virtual directory is in the same web site and web server.

Any ideas ?

well if you have two directories that is in the same root you could use something like the ../ expression to back up and or move forward as per your needs.

example:

directory1: mysite.com/my_first_folder/firstpage.aspx

directory2: mysite.com/my_second_folder/secondpage.aspx

to get from directory2 to myfirstpage.aspx in directory1 folder, i might use something like: ../my_first_folder/firstpage.aspx

hope this helps.

0 comments:

Post a Comment