views:

48

answers:

1

My asp.net web application works fine locally and when I deploy it as the default web site on my test server. So for example, when I type http:// 10.10.10.100 it works fine.

I created a virtual directory called "Test" under my "Default Web Site".

When I type http://10.10.10.100/Test it loads correctly to my log-in page, however when I log-in and click on a link it goes back to my log-in page and the url goes back referencing http://10.10.10.100 instead of http://10.10.10.100/Test/Default.aspx, for example.

My goal here is to run my application from the virtual directory and not as the default, but I don't want to change my code to a hard coded path since then it won't work anywhere else.

Any workarounds for this?

A: 

You have left a few unanswered questions, but some things to check:

  1. Which links are you using? In other words, are they plain HTML links (<a href=""> links), ASP.NET links (<asp:HyperLink>), LinkButtons (<asp:LinkButton>), etc.?
  2. How are you specifying the URL in those links? ASP.NET has a "shortcut" for root directory of the website if you use the tilde (~) character. So, to link to a page on your site called "MyPage.aspx", you might use "~/MyPage.aspx".
Andrew
originally, the application was using <a href="">. However, I changed them to ASPxHyperLink. <dx:ASPxHyperLink ID="Campaigns" runat="server" Text="Campaigns" Font-Bold ="true" Width="92px" Cursor="pointer" NavigateUrl ="~/Campaign/Default.aspx"/></li>
My application seems to be working now after being published to my target server. I appreciate your help.