ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 24th, 2003, 11:11 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
title of parent window

is there anyway to get the title of the window that opened a new window? in javascript it would be window.opener.document.title but is it even possible to get that with asp?
__________________
My brain cells are like a storm trooper's armor: useless

Reply With Quote
  #2  
Old September 24th, 2003, 11:39 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Well *what triggered* the new window in the first place???

For example, assuming I'm inside page1.asp and I create a link that once clicked, opens a new window. But I'd also like to pass the *name* of the parent window to the new window...so:

---------------page1.asp----------------

<html>
<body>

<a href="javascript:OpenNew();">My Link</a>

</body>
</html>
------------------------------------------------

You'll notice that I have not created the OpenNew() function I'm about to create it but I'm showing step by step...now let's add the function between the <head>...</head> portion of your code

-----------------------------
<head>
<script language="javascript">
function OpenNew()
{

window.open("page2.asp")
}
</script>
</head>
-----------------------------

Now if I click on the My Link link, it should open a new window calling page2.asp

Now what you **could do** because I've never tried it/never used it before is something like this:
You'll need to add code inside the javascript function:

-----------------------------
<head>
<script language="javascript">
function OpenNew()
{

var TheName;
TheName = window.name;
//FOR DEBUG ONLY
//alert(TheName);


window.open("page2.asp?name="+TheName)
}
</script>
</head>
-----------------------------

Look at the bold stuff I've written...the idea is that you pass a *QueryString* parameter called name the value is the javascript variable TheName that guess what??? holds the name of the window.

Then all you have to do is inside page2.asp retrieve the name inside the QueryString like:

--------------------page2.asp-----------------
<%
Dim strWindowName
strWindowName = Request.QueryString("name")
'FOR DEBUG ONLY
Response.Write strWindowName & "<hr>"
Response.End
%>
----------------------------------------------------

You get the idea...again, don't know if it works or not since I've never used that but give it a try!

Hope this helps!
Sincerely

Vlince

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > title of parent window


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway