Solved

Another page opens after I use this code

Posted on 2013-06-17
1
206 Views
Last Modified: 2013-06-18
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

0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
Mrunal earned 500 total points
ID: 39255464
try this:

window.open("webpage.htm", "_self");

OR

window.location.href = "webpage.htm";

More information:

http://stackoverflow.com/questions/4813879/window-open-target-self-v-window-location-href
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question