title: Redirect a new page from server
body: <p>I have this WebMethod that redirects to another page on that server.</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
  public static Boolean realizaConsulta(Dictionary&lt;string, string&gt; datos)
  {
      System.Web.HttpContext.Current.Response.Redirect("PRepConsulta.aspx", false);
  }
  </code></pre>
  
  <p>But i get this error:</p>
  
  <blockquote>
    <p>Microsoft JScript runtime error: Sys.Net.WebServiceFailedException:
    The server method 'realizaConsulta' failed with the following error:
    System.InvalidOperationException-- Authentication failed.</p>
  </blockquote>
  
  <p>What causes this error?</p>
  
  <hr>
  
  <p>look the other options i have tried:</p>
  
  <pre><code>        [WebMethod]
          [ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
          public static Boolean realizaConsulta(Dictionary&lt;string, string&gt; datos)
          {
             System.Web.HttpContext.Current.Server.Execute("PRepConsulta.aspx", false);
          }
  </code></pre>
  
  <p>IT WORKS, BECAUSE, IT GOES TO PRepConsulta.aspx AND EXECUTE THE UNDERCODE, BUT THE PAGE NEVER SHOWS UP.</p>
  
  <p>I HAVE ALSO TRIED:</p>
  
  <pre><code>        [WebMethod]
          [ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
          public static Boolean realizaConsulta(Dictionary&lt;string, string&gt; datos)
          {
                 HttpContext.Current.Server.Transfer("PRepConsulta.aspx", false);
          }
  </code></pre>
  
  <p>BUT I GOT THIS ERROR:</p>
  
  <p>Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'realizaConsulta' failed with the following error: System.Threading.ThreadAbortException-- Subproceso anulado.</p>
  
  <p>I DONT KNOW WHAT ELSE TO TRY</p>
  
  <p>THANKS FOR ANY HELP</p>