A
Alan Cohen
This seems like a really, really dumb question, but I can't seem to find
the simple answer that it seems to deserve.
My C#/ASP.net 2.0 app needs to email a URL link back to the site from a
web page. Sending the email is no problem, but generating this URL is
giving me an annoying issue in testing because of the difference in URLs
between the VS web server and IIS.
Specifically, the URL that I need to send when testing locally (VS
built-in web server) is http://localhost:4323/Safely-Sent/Validate.aspx.
However, in IIS, I need http://Safely-Sent.com/Validate.aspx.
So, I'd like to have a magic function that returns the correct 'base'
url (http://localhost:4323/Safely-Sent/ or http://Safely-Sent.com) for
my running instance as appropriate, onto which I can append my page
name. I looked at Request object properties, and at UriBuilder, but
nothing looked like what's needed.
Is there something trivial that I'm overlooking?
Thanks in advance!
the simple answer that it seems to deserve.
My C#/ASP.net 2.0 app needs to email a URL link back to the site from a
web page. Sending the email is no problem, but generating this URL is
giving me an annoying issue in testing because of the difference in URLs
between the VS web server and IIS.
Specifically, the URL that I need to send when testing locally (VS
built-in web server) is http://localhost:4323/Safely-Sent/Validate.aspx.
However, in IIS, I need http://Safely-Sent.com/Validate.aspx.
So, I'd like to have a magic function that returns the correct 'base'
url (http://localhost:4323/Safely-Sent/ or http://Safely-Sent.com) for
my running instance as appropriate, onto which I can append my page
name. I looked at Request object properties, and at UriBuilder, but
nothing looked like what's needed.
Is there something trivial that I'm overlooking?
Thanks in advance!