468,544 Members | 1,810 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

Retrieving the redirected URL

Hi there, is it possible to retrieve the URL of a webpage which a user has been redirected to using some tags in ASP?

I'm building a site where the user is redirected to an external webpage when they select a button. This external page is almost always different each time.

I have been able to embed a redirect using:

<form method="POST" action="http://dx.doi.org" runat="server">
<input type="submit"/>

but I don't know how I could code some sort of a method="GET" using a dynamic URL.
Mar 9 '10 #1
8 2467
RedSon
5,000 Expert 4TB
don't you have some kind of get method and in that can't you add some kind of response.redirect(url)?
Mar 9 '10 #2
Yes, but that takes you to a "known" url.
I want to find a way to retrieve a url which is unknown until a user is redirected to it. Anyway, after talking about this with my supervisor, it seems that this is possible with an
Expand|Select|Wrap|Line Numbers
  1. <a href= "" >
tag, but I'm not so sure as according to:

http://www.w3schools.com/HTML/html_links.asp

this tag is a hyperlink.
Mar 10 '10 #3
RedSon
5,000 Expert 4TB
How can you redirect a user to an unknown URL that is not known until the user is redirected to it? Do you not see the circular logic in that?
Mar 10 '10 #4
I don't want to "re-direct" them to an unknown URL, I want to be able to retrieve the url of a site they have been moved to. Here's the plan?

1. Enter information into text box.
2. Click on submit button.
3. Retrieve the resulting url that a user would have been redirected to if they had used the DOI website http://dx.doi.org/
4. Do stuff with the URL retrieved from step 2 e.g. read text, look for strings, look for pictures, etc.

I don't know if this is possible with html and/or C#.
I am developing the site in C#
Mar 10 '10 #5
RedSon
5,000 Expert 4TB
You are writing a web proxy? When someone enters in whatever a "doi" is you want to navigate to that site and download it?

Also, as a side note, you realise that doi is an alternate spelling of the word "doy" (http://www.urbandictionary.com/define.php?term=doy)
Mar 11 '10 #6
No I'm not redirecting to a web proxy or downloading the doi, just screen scraping the site that it redirects to, which is unknown until the user redirects to it.
Mar 11 '10 #7
jhardman
3,405 Expert 2GB
the standard method is to redirect to a page within your website first, track where they are going, then send them on their way. Does this make sense?

Jared
Mar 11 '10 #8
GazMathias
200 Expert 100+
A couple of ideas. Not sure exactly how the dynamics of what you want to do work, but:

Use the microsoft.xmlhttp object to return the results page of the doi lookup and parse (if the page isn't automatically redirected by the lookup), then redirect them yourself.

Open the doi page in a frame, use javascript to grab the url of the page they get redirected to within the frame.

May be grasping at straws a bit there.

Gaz,
Mar 12 '10 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Miko | last post: by
3 posts views Thread by George B | last post: by
1 post views Thread by Jack | last post: by
7 posts views Thread by CCC via DBMonster.com | last post: by
2 posts views Thread by B. Hummer | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.