Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Another page opens after I use this code

I'm using this example to print a  page (the code is in the middle of the page)

http://www.codeproject.com/Articles/13795/Creating-print-preview-page-dynamically-in-ASP-NET

1. I have an aspx page.lets call it xyz.aspx... with a ModalPopupExtender. User clicks on a link and the modal page shows up

2. On the ModalPopupExtender page, I have a print button and use the code in the link above

3. User clicks print, page is printed

4. So far so good

5. But, now, another page in another tab opens and it's xzy.aspx. So, after the print, I have 2 tabs with xyz.aspx opened!  The URL on the second page is "about:blank"

This is how I call that Javascript. Do I need "return true;" after it??
btnPrint.Attributes.Add("Onclick", "getPrint('print_area');");

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial