Solved

Another page opens after I use this code

Posted on 2013-06-17
1
201 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
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 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