473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2053
Sounds like a job for client side javascript:
window.open('MyPage.aspx','_blank');
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**********@InfoPathDev.com> wrote in message
news:%2****************@TK2MSFTNGP09.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:
RegisterStartupScript("startupScript", "<script
language=JavaScript>window.open('test.aspx','_blan k');</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**********@InfoPathDev.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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 RegisterStartupScrip
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
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...
6
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...
4
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...
1
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...
2
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...
3
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...
3
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...
1
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....
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.