title: Get absolute URL path of an action from within Global.asax
body: <p>Sorry for the basic question.</p>
  
  <p>From within the <code>Global.asax</code>, I want to get the absolute path to a controller's action, like we get by calling <code>Response.Redirect("~/subfolder")</code> from anywhere or by calling <code>@Url.Content("~/controller/action")</code> from within our views.</p>
  
  <p>In my Global.asax events, I'd like to do something like this:</p>
  
  <pre><code>protected void Application_BeginRequest(object sender, EventArgs args)
  {
    if ( string.Compare(HttpContext.Current.Request.RawUrl, "~/foo", true) == 0 )
      // do something
  
      // I'd like the "~foo" to resolve to the virtual path relative to 
      // the application root
  }
  </code></pre>