<p>I have a method that where I want to redirect the user back to a login page located at the root of my web application.</p>

<p>I'm using the following code:</p>

<pre><code>Response.Redirect("~/Login.aspx?ReturnPath=" + Request.Url.ToString());
</code></pre>

<p>This doesn't work though.  My assumption was that ASP.NET would automatically resolve the URL into the correct path.  Normally, I would just use</p>

<pre><code>Response.Redirect("../Login.aspx?ReturnPath=" + Request.Url.ToString());
</code></pre>

<p>but this code is on a master page, and can be executed from any folder level.  How do I get around this issue?</p>

What about using
```
```
Response.Redirect(String.Format("http://{0}/Login.aspx?ReturnPath={1}", Request.ServerVariables["SERVER_NAME"], Request.Url.ToString()));
```
```