Click here to Skip to main content
16,020,822 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
In my web application i have two checkboxes.
If user checked X, then open X.pdf.
If user checked Y, then open Y.pdf.
Upto this its working fine.
But what i want is if user checkd both checkboxes, then need to open both documents one after another.

So code will be something like this:

private void xyz()
{
    ScriptManager.RegisterStartupScript(base.Page, base.Page.GetType(), "check1", "window.open('../X.pdf');", true);
    ScriptManager.RegisterStartupScript(base.Page, base.Page.GetType(), "check2", "window.open('../Y.pdf');", true);

}

But it only opens first pdf.
Please let me know if anyone wants more clearity about my question..
Posted
Updated 30-Jan-11 23:01pm
v2
Comments
Prerak Patel 31-Jan-11 5:02am    
It opens both the documents here without any problem. Get some more details.
Sandeep Mewara 31-Jan-11 5:13am    
You want to open both document in same window one after other? Or you are fine with multiple windows. Kindly clarify.
Pravin Patil, Mumbai 31-Jan-11 5:15am    
Hi Ravi, As far as I know, you can open only one window in javascript at a time.
Sandeep Mewara 31-Jan-11 5:28am    
You can open more than one. :)
Above code actually is doing exactly that. (2 new windows with different contents.)
Umair Feroze 31-Jan-11 5:18am    
I tried the code and found no issue with. It opened two files in two different windows. I think there is some other issue with your code. May be there is some logical error while calling the function

1 solution

I put your code, in a new page, it works nice. I think problem is somewhere else. So, give more code of your page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900