title: Hyperlink with query string and open in new window in asp.net Datagrid
body: <p>First of all, I have searched probably all threads on Stack OverFlow about my problem. Since I haven't find any expected result, so I forced my self to post this question.</p>
  
  <h2>My problem is: I am using hyperlink in datagrid and passing datafield as querystring, I want pop-up window to be open with querystring in URL, when click on following link.</h2>
  
  <pre><code>&lt;asp:HyperLink ID="lnkViewDoc" Text='View Document' NavigateUrl='&lt;%# string.Format("javascript:window.open('ViewDoc.aspx?DocP={0}', 'MsgWindow','width=200,height=100')", Eval("vchDocPath")) %&gt;' runat="server"&gt;&lt;/asp:HyperLink&gt;
  </code></pre>
  
  <h2>On above code, I am getting error "The server tag is not well performed.". Can anyone please provide me exact code?</h2>
  
  <hr>
  
  <p>I tried another format. In following code, I am not getting error, but when clicking on link, nothing is happening like link is not clickable.</p>
  
  <pre><code>&lt;asp:HyperLink ID="lnkViewDoc" Text='View Document' NavigateUrl='Javascript:void(window.open("&lt;%# Eval("vchDocPath", "ViewDoc.aspx?DocP={0}") %&gt;","mywindow","toolbar=0,width=500,height=500"))' runat="server"&gt;&lt;/asp:HyperLink&gt;
  </code></pre>
  
  <hr>
  
  <p>P.S: I have tried many other formats from stack overflow and other sites, but no luck.</p>
  
  <p>Thanks in advance.</p>