Open multiple browser windows

Discussion in 'ASP .Net' started by Ayoa, Sep 9, 2005.

  1. Ayoa

    Ayoa Guest

    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
    Ayoa, Sep 9, 2005
    #1
    1. Advertising

  2. 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
    >
    >
    >
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Sep 9, 2005
    #2
    1. Advertising

  3. Ayoa

    Ayoa Guest

    Thanks for your reply. I am specifying the target window as "_blank"
    Ayoa, Sep 12, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ayoa

    Open multiple browser windows

    Ayoa, Sep 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    419
  2. ai4u
    Replies:
    0
    Views:
    2,803
  3. dnes
    Replies:
    1
    Views:
    599
  4. tiewknvc9
    Replies:
    12
    Views:
    1,277
    Chris Uppal
    Feb 19, 2007
  5. Replies:
    1
    Views:
    248
Loading...

Share This Page