473,659 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open New Window and Redirect Old

I've searched around and can't seem to find an answer to this... maybe someone has already done it.

I want to create a redirection page for hyperlinks which point to an external site or file. This is so that I can keep track of how many visitors are linking to external resources from the site using the hosting server's statistics package.

Due to technical constraints that I don't want to get into right here, I am unable to have the original link open the new browser window... I need to be able to do this with aspx code.

Here's what I want to do: When a user clicks a link on a page, they go to a link such as the following:

http://www.mysite.com/redirect.aspx?...older/file.zip

When they get to the redirect.aspx page, I want to:

1. Open a new blank browser window which will load the offsite url.
2. Redirect back to the referring url with no history of having visted the redirection page.

Is this even possible?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Nov 18 '05 #1
4 2067
Sounds like a job for client side javascript:
window.open('My Page.aspx','_bl ank');
history.go(-1);

Here's more info:
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Greg Collins [MVP]" <Gr**********@I nfoPathDev.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I've searched around and can't seem to find an answer to this... maybe
someone has already done it.

I want to create a redirection page for hyperlinks which point to an
external site or file. This is so that I can keep track of how many visitors
are linking to external resources from the site using the hosting server's
statistics package.

Due to technical constraints that I don't want to get into right here, I am
unable to have the original link open the new browser window... I need to be
able to do this with aspx code.

Here's what I want to do: When a user clicks a link on a page, they go to a
link such as the following:
http://www.mysite.com/redirect.aspx?...older/file.zip

When they get to the redirect.aspx page, I want to:

1. Open a new blank browser window which will load the offsite url.
2. Redirect back to the referring url with no history of having visted
the redirection page.

Is this even possible?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com


Nov 18 '05 #2
Is there no way to do this serverside? I'd rather not have to go clientside if I can at all avoid it.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
Nov 18 '05 #3
Not really, this is client side functionality controlled by the browser, so
you have to talk directly with the browser.
However, you can output this client side code from your server side code.
For example, try this server code:
RegisterStartup Script("startup Script", "<script
language=JavaSc ript>window.ope n('test.aspx',' _blank');</script>")

Here's more info:
http://msdn.microsoft.com/library/de...criptTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Greg Collins [MVP]" <Gr**********@I nfoPathDev.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
Is there no way to do this serverside? I'd rather not have to go clientside
if I can at all avoid it.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
Nov 18 '05 #4

I had a consultant do some work and he used RegisterStartup Scrip
throughout the site to pass javascript back to the page in order t
open a new window controlling size, menubar, etc. of it. PROBLEM is..
it puts javascript on the page that automatically opens this new windo
when the page loads... which pop-up blockers don't like. Pop-up blocker
don't block user initiated onClick events, but javascript that isn'
user controlled is blocked

We tried getting around it by openning dialogue windows instead o
window.open whic worked, except no menubar is shown.

I'm almost to the point to not open any windows from the site... whic
would really suck. I need to keep a main window open and open report
in additional windows. Sometimes multiple reports to compar
side-by-side. I really don't want to re-write the entire site to ge
windows to open either

Is there a way to open a new window after doing some processing serve
side that doesn't get blocked by pop-up blockers???

HELP!!! PLEASE!!! IT'S DRIVIN' ME NUTS!!
-
csuttma
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1821
by: Krechting | last post by:
Hi All, I need a button on my form that opens a new window. I put in a submit button but it always returns to my first page. And then my first page is empty. What button do I need to go to another page (weapon_related)? This is what I use at the moment: 'NewRecord1 Operation Method @3-0C905987
6
12156
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page where I can set the window height, statusbar=no, etc? Thanks, -Luke
4
629
by: margaret | last post by:
James suggested that I used window.open on the client side to open a new window. I created a test ASP app and can get it work fine. But now I'm trying to fix my real app, which is in ASP.NET. It uses a button with the button handler in the C# code-behind page calling Response.Redirect. I can't find anything that's equivalent to window.open and I don't know enough about ASP to figure out how or where to put the window.open and still...
1
1556
by: bubbles | last post by:
hi, I've got an aspx page with a button. Upon clicking this button, it will pop up a new window to go a new page. At the same time, the parent window will redirect itself to another page. How can this be done? Thanks !!
2
2991
by: nntp | last post by:
Are there other ways to open multile windows at once? <SCRIPT language="JavaScript"> function open1() { var open1 = window.open('http://google.com/CheckEnviro.pl','','scrollbars=yes,height=600 ,width=800,resizable=yes'); } function open2() { var open2 =
3
12970
by: eieed | last post by:
I have a web page that is designed to allow users to run crystal reports which are then exported into PDF formats. Currently, when the user clicks the "Submit" button there is some processing to build the PDF file and then I use a Response.Redirect("Exported\\crystal_report_name.pdf)"; command to redirect the page. However, the user wants the PDF file to open in a new window. Is there a way I can do this? It doesn't have to be...
3
3567
by: ODB | last post by:
Okay what i need is to open af new browser windows with some link in, but i can't get the Response.Redirect to open af new window, and when i redirect to a new page in the same window and then hit back, i have some olde invalid data in my window. and i realy need to open af new browser ? Thanks ODB
1
3559
by: RJN | last post by:
Hi Sorry for posting again. I open a few pop-up windows from a main window. If session time out occurs in either the main window or the pop-up windows ,I redirect the user to login screen. Currently what is happening is , suppose session times out in a pop-up window, then the login screen opens in the same window. I want to close all the Pop-up window, main window and redirect the user to the login screen. If I can redirect to the main...
2
2642
by: John at Free Design | last post by:
Can anyone help with how to use the Response.Redirect method to open a page in a new instance of the browser. In this case it is a report. When the user selects a report from a list then I want to display the report but when they close the report the resport list window (browser) should stay open. Any help would be greatly appeciated. Thanks. -- John at Free Design
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.