Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.ApplicationPath

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
I would like to know where the Framework gets the value that Request.ApplicationPath returns.

I have often used it to make sure I am not hardcoding my server.Transfer and response.redirect bits.

For example I want to transfer the page to say bubba.aspx with some querystring variables

Response.Redirect(Request.ApplicationPath + "/bubba.aspx?Center=" + myCenterVariable.ToString());

The problem is that when I uploaded this to the production server application path is returning "/". So I get the page not found error and the address bar shows
"
It should be showing "My development machine does work as it shows.
"
Not quite sure what is going on here and my brain is hurting me. Your help is appreciated.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Have you tried:

Response.Redirect("../bubba.aspx?Center=" + myCenterVariable.ToString());
 
That does work but I still would like to know where the Framework gets the value that Request.ApplicationPath returns

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I assume that you are working from a virtual directory in your development environment, so ApplicationPath returns localhost/virtdir. When you move the site to production you are in a "web site", not a virtual directory, so the applicationpath is "/" root.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top