Reputation: 813
I have a little problem with my Redirect in ASP.NET (C#)
I just got a domain which looks like this: http://www.example.com/subdirectory
So when I open my asp.net start page, the url looks like this: http://www.example.com/subdirectory/Startpage/Startpage.aspx
That's my Redirect in code behind:
Response.Redirect("~/UserSite/UserSite.aspx")
The problem now is, when I click on that button, I get redirected to
http://www.example.com/UserSite/UserSite.aspx
instead of
http://www.example.com/subdirectory/UserSite/UserSite.aspx
How can I get my web page to notice the subdirectory in the url?
Would be nice if someone could help me. Thanks.
Upvotes: 2
Views: 1777
Reputation: 626
This may be because your website under the sub-drecitory hasn't been setup as it's own application within IIS7.
You can do this by:
Response.Redirect("~/UserSite/UserSite.aspx") should then understand that /subdirectory/ is the default website directory
Upvotes: 2