On my development server HttpContext.Current.Request.ApplicationPath correctly returns the path, but on production it returns empty.
Why woudld this be?
I am using this to build URL's, and now in production a link doesn't work as it looks like:
http://section/page1.aspx
but it should be:
https://www.example.sub.com/section/page1.aspx
What could be causing this?
The ApplicationPath property returns the path to the folder where the application is, and it doesn't include the domain name.
I imagine that you have put the application in a folder with the same name as the domain name in your development server. The property then returns the name of the folder, not the actual domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With