John's got it right. You can/should use the HttpContext.Current.Request object as he stated. I think you are also looking for the Url up to the root only. In other words, you don't want the page name or query string params if they exist.
This routine is a little obnoxious but it should give you what you need. Notice the reference to HttpContext.Current.Request.
private string UrlUpToRootWithNoPageReferenceOrQueryStringParameters()
{
string Port = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
if (Port == null || Port == "80" || Port == "443")
Port = "";
else
Port = ":" + Port;
string Protocol = HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"];
if (Protocol == null || Protocol == "0")
Protocol = "http://";
else
Protocol = "https://";
return Protocol + Context.Request.ServerVariables["SERVER_NAME"] + Port + Context.Request.ApplicationPath;
}
There are shorter ways to get what you want, but again the routine above will work. If you're interested in more, check out Rick Strahl's Making Sense of ASP.NET Paths for more.