If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > General Question - To get the URL of parent window

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-11, 05:48
veggiop veggiop is offline
Registered User
 
Join Date: Mar 2011
Posts: 10
General Question - To get the URL of parent window

Hi Everyone,
I am new to classic ASP.I have a general question.
I have to get the url of the parent page in my asp page.
Is there any way to get the Parent window's url in asp.


I Know that the value could be obtained in javascript using window.parent.location.href ,then stored in a hidden variable
and could obtain it using Request.Form .But this solution requires the form to be submitted I don't want that to happen.

And even Request.ServerVariables(HTTP_Referer) does not work since my page opens in a new window.

Any Ideas ??
Any Suggestions??

Thanks in Advance
Reply With Quote
  #2 (permalink)  
Old 04-07-11, 23:35
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
From within ASP you can't. You have to use javascript.

Having said that, if it is the "click a button and submit" part you are concerned about you can also grab the data and then do a client side redirect or an javascript post to get the information.

What are you actually trying to do? Detect if you are wrapped in another window and break out??
Reply With Quote
  #3 (permalink)  
Old 04-09-11, 08:05
work8686 work8686 is offline
Registered User
 
Join Date: Feb 2011
Location: Indore India
Posts: 2
Post I suggest....

I suggest you to switch to ASP.NET 4.0. The classic ASP does not have many features that are provided in ASP.NET.

In ASP.NET you can get the URL directly so it is no big issue there.

Regards
Market Research
Reply With Quote
  #4 (permalink)  
Old 04-10-11, 16:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Even if you switch to 4.0 you would still have to use a client side javascript to grab the URL of a parent window. The core functions of ASP happen on the server, not on the client. When you use the built in client controls you should see links to client side javascript that is actually doing the work.
Reply With Quote
  #5 (permalink)  
Old 04-12-11, 19:03
SimonMT SimonMT is offline
Registered User
 
Join Date: Sep 2006
Posts: 265
You could try setting a Session Variable at the Parent asp form before you open a New Form.

Simon
Reply With Quote
  #6 (permalink)  
Old 04-12-11, 19:23
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Assuming you have control over that parent window,....

Really it depends what situation the OP is actually trying to resolve and as they haven't posted back since the first post I'd have to assume it's resolved or not really that criticial.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On