Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I tested this and it does open the three windows, you'll have to tweak it a bit by passing a list of selected IDs to Material, so that you call Material just once. Inside material in your string manipulation, after the following line,</p> <pre><code>Script += "&lt;script language=JavaScript id='PopupWindow'&gt;"; </code></pre> <p>add a for loop that goes though the selected IDs and adds a window.open. So, the following lines should be in the for/foreach loop</p> <pre><code>string querystring = "../pmis/Reports/RptRFQMatV.aspx?RFQNo=" + lblRFQNo.Text.ToString() + "&amp;ID=" + sID; Script += "confirmWin = window.open(' " + querystring + "','" + r.Next() + "','scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');"; </code></pre> <p>and then the following lines follow and are outside the for loop.</p> <pre><code>Script += "confirmWin.Setfocus()&lt;/script&gt;"; //ClientScript.RegisterStartupScript(typeof(string), "PopupScript", "PopupWindow"); if (!ClientScript.IsClientScriptBlockRegistered("PopupWindow")) ClientScript.RegisterClientScriptBlock(typeof(string), "PopupWindow", Script); </code></pre> <p>This is my example and works. Also, would be better if you use StringBuilder instead of string +=</p> <pre><code> string Script = ""; Script += "&lt;script language=JavaScript id='PopupWindow'&gt;"; Script += "window.open('www.google.com.au', '1','scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');"; Script += "window.open('www.yahoo.com','2','scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');"; Script += "window.open('www.stackoverflow.com','3', 'scrollbars=yes,resizable=1, width=960,height=500,left=50,top=130,status');"; Script += "&lt;/script&gt;"; if (!ClientScript.IsClientScriptBlockRegistered("PopupWindow")) ClientScript.RegisterClientScriptBlock(typeof(string), "PopupWindow", Script); </code></pre> <p>Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload