title: url encoding with javascript window open
body: <p>ASP.NET 4.0, webform site</p>
  
  <p>There is a link in my site is to call another page and pass url parameters, it looks like below.</p>
  
  <p><a href="http://www.foo.com/foo.aspx?anotherURI?param1=aaa&amp;26param2=bbb" rel="nofollow">http://www.foo.com/foo.aspx?anotherURI?param1=aaa&amp;26param2=bbb</a></p>
  
  <p>However, I need to do url encode for "anotherURI?param1=aaa&amp;26param2=bbb", so it turns into:</p>
  
  <p><a href="http://www.foo.com/foo.aspx?anotherURI?param1%3Daaa%26param2%3Dbbb" rel="nofollow">http://www.foo.com/foo.aspx?anotherURI?param1%3Daaa%26param2%3Dbbb</a></p>
  
  <p>Now if I want to enclose this with javascript, it won't work. How do I encode the url again?</p>
  
  <pre><code>javascript:void(window.open('http://www.foo.com/foo.aspx?anotherURI?param1%3Daaa%26param2%3Dbbb', 'popup'))
  </code></pre>