Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Another page opens after I use this code

Posted on 2013-06-17
1
Medium Priority
?
211 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

661 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