Click here to Skip to main content
15,885,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

In my asp.net application, i need to show two different Popup window containing two different report to take Printout.

Hence while click i need to show two Popup's at a time.Here is the code i used for showing popup. I tried to run same script twice(with different Page.aspx) but at finally only one Popup are shown.


C#
string url = "Billview.aspx";
string fullURL = "window.open('" + url + "', '_blank', 'height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
Posted

1 solution

This isn't really server-side, you're just registering some JavaScript to run on page load. So just update the JavaScript to open two windows:

string url1 = "Billview.aspx", url2 = "Whatever.aspx?somestuff=42";
string js = "window.open('" + url1 + "', '_blank', 'height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );\n" +
    "window.open('" + url2 + "', '_blank', 'height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", js, true);
 
Share this answer
 
Comments
J.Karthick 2-Nov-11 8:18am    
Thanks for your reply...Will check this out

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