K
kewl
Hi All,
We have an ASP.NET 2.0 (C#) intranet application that needs to spawn multiple browsers using RegisterClientScriptBlock. Here's what we got so far:
// Go thru each datarow in the datatable
foreach (System.Data.DataRow drReportGroupsDetails in tableReportGroupsDetails.Rows)
{
// Get the needed values from the datatable
string reportName = (string)drReportGroupsDetails["ReportName"];
string reportPath = (string)drReportGroupsDetails["ReportPath"];
// Do other work ...
// Build the URL - NOTE: The reportName and reportPath variables are different each time thru the loop
url = "http://localhost/..." + reportName + "..." + reportPath + "...";
// Build the javascript to display the message
sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"GenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GenerateReport", sScript);
}
So, we have a method that iterates through a set of rows in a datatable, builds a URL, builds the JavaScript to open a new window (using window.open), and then executes the script using Page.ClientScript.RegisterClientScriptBlock.
The problem is that only one browser is popped-up. It's for the last row in the datatable.
How can we pop-up a new browser instance for each row in the datatable?
Thanks.
We have an ASP.NET 2.0 (C#) intranet application that needs to spawn multiple browsers using RegisterClientScriptBlock. Here's what we got so far:
// Go thru each datarow in the datatable
foreach (System.Data.DataRow drReportGroupsDetails in tableReportGroupsDetails.Rows)
{
// Get the needed values from the datatable
string reportName = (string)drReportGroupsDetails["ReportName"];
string reportPath = (string)drReportGroupsDetails["ReportPath"];
// Do other work ...
// Build the URL - NOTE: The reportName and reportPath variables are different each time thru the loop
url = "http://localhost/..." + reportName + "..." + reportPath + "...";
// Build the javascript to display the message
sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"GenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GenerateReport", sScript);
}
So, we have a method that iterates through a set of rows in a datatable, builds a URL, builds the JavaScript to open a new window (using window.open), and then executes the script using Page.ClientScript.RegisterClientScriptBlock.
The problem is that only one browser is popped-up. It's for the last row in the datatable.
How can we pop-up a new browser instance for each row in the datatable?
Thanks.