Hi,
I've got a web app that I deploy to several applications like so-
https://customerinternaldomain.com/thewebapp
There are a lot links that pop open windows. In the past I was using the following to determine the url of the window to pop.
string appPath = this.Request.ApplicationPath;
if ( !appPath.EndsWith ( "/" ) )
appPath += "/";
string sURL = this.Request.Url.Scheme + "://" + this.Request.Url.Authority
+ appPath
Then I just append on the path to the window page that I want to open like so
appPath += "somefolder/window.aspx"
One of our installations just moved to a non standard port, something like 20055.
So I've fooled around with coming up with a clean full proof way to make sure that the port is inserted in the path, but since the webapp is mapped to https://internaldomain.com/thewebapp instead of just https://internaldomain.com/ I'm not seeing a clean way using Request server variables to do this. Sure I can hack and slash with splits or something, or store the base web path in a config file that gets read. Just wondering if anyone had a clean way of doing this. Assuming something obvious that I'm just missing, so I figured I'd put the best and brightest on it.
Thanks for any help you provide, I know time is valuable. I appreciate it.