Solved

Another page opens after I use this code

Posted on 2013-06-17
1
196 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
1 Comment
 
LVL 22

Accepted Solution

by:
Mrunal earned 500 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now