How come this redirect does not work with this section of code?
<pre><code>foreach (string oName in oValues)
{
    if (string.IsNullOrEmpty(Request.Form[oName]))
    {
     oCount += 1;
    }
}
if (oCount == 0)
{
    _clientID = Request.Form["ClientID"];
    _password = Request.Form["Password"];
    _pracType = Request.Form["PracType"];
    _encrypt = Request.Form["Encrypt"];

    if (GetCRC(_clientID) == _password)
    {
     if (_clientID != null)
     {
      var verify = VerifyClientInformation(int.Parse(_clientID));
      var gsa = new GSDataLayer.Authentication.Auth();

      gsa.CreateAuthEntry(_clientID, _password, _pracType, _encrypt, verify.CanUpdate);
      _aMgr.GotoHomePage();
     }
     else
     {
      error.Text = "This conditional failed.";
     }
    }
    else
    {
     _aMgr.GotoErrorPage("nocrc"); 
    }

}
else
{
    _aMgr.GotoErrorPage("noform");  
}
</code></pre>

<p>the <code>GotoErrorPage</code> method:</p>

<pre><code>public void GotoErrorPage(string errorcode)
{
    if (HttpContext.Current.Request.UserHostAddress != "127.0.0.1") // for testing only
    {
     var instance = new Control();
     HttpContext.Current.Response.Buffer = true;
     HttpContext.Current.Response.Clear();
     HttpContext.Current.Response.Redirect(instance.ResolveClientUrl(
         string.Format("~/ErrorPage.aspx?e={0}", errorcode)));
     HttpContext.Current.Response.End();
    }
}
</code></pre>

<p>If <code>oCount</code> is 0, it redirects just fine but if it is > 0 the redirect does not happen. Any ideas on why this might be?</p>

<p>thanks</p>

<h1>edit</h1>

<p>Well, I feel rather silly...the conditional for the <code>UserHostAddress</code> in <code>GotoErrorPage()</code> was the culprit. I had forgotten that this was remnant from my initial testing because I did not want any redirects to happen, just outputting text (errors, results, etc). After removing that conditional, redirects happen just fine.</p>

<p>What is throwing me for a spin, though, is it was working fine earlier. Although, I think I also figured that out as well. Since I am developing this on a network, some of my colleagues can access it via the intranet by using my computer's name (<code>program003</code>) instead of <code>localhost</code>. I think before the 'problem' showed up, I was using my computer's name instead of <code>localhost</code> while testing. Regardless, when I use <code>localhost</code>, the IP is <code>127.0.0.1</code>, but when I use <code>program003</code> I get this IPv6 address:</p>

<blockquote>
  <p><code>fe80::b1d7:b18b:d10f:f526%8</code></p>
</blockquote>

<p>If I am not mistaken, the loopback address for IPv6 is supposed to be <code>::1</code>? Very strange.</p>
