tags:

views:

70

answers:

1

I'm trying to figure out the easiest way to get the "http://www.mydomain.com" portion of my website in code instead of having to change it manually between my development and production servers. I'm sure this is really simple, but I can't seem to find it.

Thanks!

+4  A: 
Context.Current.Request.Url.Host

is what you're looking for. If you don't have direct access to Context, you can instantiate it at HttpContext.Current.Request.Url.Host

Jonathan
And the winner is.... Jonathan!!! Thanks man.
Micah