title: Redirect using window.location doesn't work
body: <p>I searched for a related post, but all attempts have not worked.</p>
  
  <p>My problem, is that I'm trying to do a simple redirect in Javascript, using path+querystring. My code is below:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Page1.aspx.cs" Inherits="WebApplication1.Page1" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
      &lt;input type="submit" value="pesq" onclick="Redirect();"/&gt;
      &lt;/div&gt;
      &lt;/form&gt;
      &lt;script&gt;
          function Redirect()
          {
            window.location.href = 'http://localhost:61267/Page1.aspx?q=name';            
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>window.location.href is always set like <code>'http://localhost:61267/Page1.aspx'</code>.</p>
  
  <p>I have tried using window.location.search but still without success.</p>
  
  <p>What I'm doing wrong?</p>