title: how to open new window through javascript when pop up is blocked
body: <p>How can I open a new window through javascript when popup is blocked in IE and Firefox.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>&lt;%@ Page language="c#" AutoEventWireup="false" %&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &gt; 
  
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;SessionRedirect&lt;/title&gt;
      &lt;meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"&gt;
      &lt;meta name="CODE_LANGUAGE" Content="C#"&gt;
      &lt;meta name=vs_defaultClientScript content="JavaScript"&gt;
      &lt;meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5"&gt;
    &lt;/head&gt;
    &lt;body MS_POSITIONING="GridLayout"&gt;
  
      &lt;form method="post" name="frmRedirect"&gt;   
          &lt;input type="hidden" name="email" value="&lt;%=Session["Email"].ToString() %&gt;" /&gt;
          &lt;input type="hidden" name="pass" value="&lt;%= Session["PWD"].ToString() %&gt;" /&gt;
          &lt;input type="hidden" name="User" value="&lt;%= Session["User"].ToString() %&gt;" /&gt;
      &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt; 
  
      if(frmRedirect.User.value == "P")
      {
          window.open("", "Partner", "height=650,width=1075,left=100,top=100,status=1,scrollbars=1,location=1,toolbar=1;resizable=1");
          frmRedirect.target="Partner";       
          frmRedirect.action = "http://pli.cmsstag/partnerzone/index.aspx";
          document.frmRedirect.submit(); 
          location.replace("index.aspx");
      }
      else
      {
          window.open("", "Student", "height=650,width=1075,left=100,top=100,status=1,scrollbars=1,location=1,toolbar=1;resizable=1");
          frmRedirect.target="Student";
          frmRedirect.action = "http://pli.cmsstag/studentzone/index.aspx";
          document.frmRedirect.submit(); 
          location.replace("index.aspx");
      }   
  
  &lt;/script&gt;
  
  &lt;%
      Session.Remove("registration");
      Session.Remove("User");
      Session.Remove("UserId");
      Session.Remove("UserLoggedIn");
      Session.Remove("AgentCode");
      Session.Abandon();
  %&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>all the above code is working fine, until the browser has blocked the popup. I am trying to open new window through window.open, please see the above code. I want the window should open in any case, if there is pop up blocker it should also open.
  Please help!</p>