473,491 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Open multiple browser windows


I am working on some web based custom reports and i want to open multiple
browser at the click of a button. So for example if i have 2 guids in my
arraylist, i want to open 2 windows.

protected void viewReport2_Click(object sender, System.EventArgs e) {

ArrayList lstReports = new ArrayList();
lstReports.Add("A1CBA123-2881-4654-86B9-6F35BCE23604");
lstReports.Add("A16C569A-6FE4-4FE1-B401-9FA9750C689F");

foreach (string str in lstReports) {
previewReport(str);
}
}

private void previewReport (string reportGuid) {
string url;
url = "Report.aspx?" + "reportuid=" + reportGuid.ToUpper() +
"&__format=XML&account=gstt";
Response.Redirect(url, false);
}

(Note: Report.aspx will take the parameters supplied and generate reports).

In my client side i have the following _javascript.
function viewReport2(){
var form = document.getElementById("clientreports");
form.target = document.getElementById("__newWindow").checked == true ?
"_blank" : "_self";
}
which i call from the eventhandler of the button
_btnViewReport2.Click += new System.EventHandler(this.viewReport2_Click);
_btnViewReport2.Attributes.Add("onclick", "return viewReport2()");
When i run the report, only 1 new window opens. Which is understandable. how
can i modify the code to get it to open multiple windows. The button ca only
be clicked once.

Thanks
Nov 19 '05 #1
2 2638
are you specifying different targets for each window... couldnt tell
initially from your code.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Ayoa" wrote:

I am working on some web based custom reports and i want to open multiple
browser at the click of a button. So for example if i have 2 guids in my
arraylist, i want to open 2 windows.

protected void viewReport2_Click(object sender, System.EventArgs e) {

ArrayList lstReports = new ArrayList();
lstReports.Add("A1CBA123-2881-4654-86B9-6F35BCE23604");
lstReports.Add("A16C569A-6FE4-4FE1-B401-9FA9750C689F");

foreach (string str in lstReports) {
previewReport(str);
}
}

private void previewReport (string reportGuid) {
string url;
url = "Report.aspx?" + "reportuid=" + reportGuid.ToUpper() +
"&__format=XML&account=gstt";
Response.Redirect(url, false);
}

(Note: Report.aspx will take the parameters supplied and generate reports).

In my client side i have the following _javascript.
function viewReport2(){
var form = document.getElementById("clientreports");
form.target = document.getElementById("__newWindow").checked == true ?
"_blank" : "_self";
}
which i call from the eventhandler of the button
_btnViewReport2.Click += new System.EventHandler(this.viewReport2_Click);
_btnViewReport2.Attributes.Add("onclick", "return viewReport2()");
When i run the report, only 1 new window opens. Which is understandable. how
can i modify the code to get it to open multiple windows. The button ca only
be clicked once.

Thanks

Nov 19 '05 #2
Thanks for your reply. I am specifying the target window as "_blank"
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
11190
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
10
6703
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
4
2116
by: Ian Sedwell | last post by:
Hi guys The following code works just fine in Netscape on MacOS and Windows. But in Explorer on MacOS and Windows it throws a type mismatch error at the point marked with the comment ³// bug out...
2
2979
by: nntp | last post by:
Are there other ways to open multile windows at once? <SCRIPT language="JavaScript"> function open1() { var open1 = window.open('http://google.com/CheckEnviro.pl','','scrollbars=yes,height=600...
4
3365
by: google | last post by:
Hi there, I've searched high and low for this, but it seems most people are looking to establish (and control) the relationship between a parent browser window and it's associated child window...
17
2006
by: DaveC | last post by:
Hi, If I set up a link to take my viewers away from my site, how can I force their browser to open a second copy? Idea, of course, is to bring viewers back into my site when they close the 2nd...
13
3288
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new...
1
3460
by: dnes | last post by:
Open Multiple New Browser Windows from ASP.NET I'm having trouble figuring out how to open multiple new browser windows (each one displaying something different). As you can see from the code...
6
2382
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am thinking about doing this since I got several cases that some of our internal users open more than one browser at the same time from our server. When one of the transactions was not...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.