|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > title of parent window |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|