Resolve relative ("~") paths without reference to the current Page?
<p>I am writing a generic library for use by all of my web projects. One of the functions is a permanent redirect as below:</p>

<pre><code>public static void PermanentRedirect(string url, HttpResponse response, bool endResponse)
{
    url = //resolve url here. how?

    response.Status = "301 Moved Permanently";
    response.AddHeader("Location", url);

    if (endResponse) response.End();
}
</code></pre>

<p>How can I resolve the URL without having to pass the current page to get access to <code>Page.ResolveUrl</code>? Note, I <em>can</em> change the method signature, but I would prefer not to because I think it would overburden the API.</p>

<p>I have a couple overloads for this so my desired usage is:</p>

<pre><code>WebUtility.PermanentRedirect("~/somewhere/somepage.aspx")
</code></pre>
