p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   response.redirect and frames issues (http://p2p.wrox.com/showthread.php?t=54610)

neil.abachi07 February 26th, 2007 08:43 PM

response.redirect and frames issues
 
hi, have created an asp login page and have created a dynamic redirect. i wanted to redirect to the parent frame/window but this cant be done in asp.

i got given a piece of js but am unsure where to implement into my asp page.

the code is:


Dim sJavaScript
sJavaScript = "<script language=javascript>"
sJavaScript = sJavaScript & "parent.frames[n].location.href='page.asp';"
sJavaScript = sJavaScript & "</scr" & "ipt>"

response.write(sJavaScript)

im guessing that the first 5 lines goes at the top along with the other dims that i have but i dont know where the response.write goes.

i was told that the [n] is an integer value or the name of the frame.

would someone mind clarifying all this for me?

many thanks


dparsons February 26th, 2007 08:55 PM

Thanks for moving your post ^^.

There are 2 secnarios here:

First: You have a layout that is comprised of frames and you want to redirect x frame to a different page based upon something that is happening in the current frame. Lets just assume that you have a layout that consists of 3 frame rows that have the names first, second, and third. Now the user preforms some action in frame 'second' that requires the page in frame 'first' to be changed you would write this script back to the browser:

Dim sJavaScript
sJavaScript = "<script language=javascript>"
sJavaScript = sJavaScript & "parent.frames['first'].location.href='page.asp';"
sJavaScript = sJavaScript & "</scr" & "ipt>"

response.write(sJavaScript)

Second secnario: You have a page layout comprised of a frameset and you need the page to redirect away from your frameset layout to just one page you would use:

parent.location.href='page.asp';

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429

neil.abachi07 February 26th, 2007 08:57 PM

thanks, thats clearer now, where does the response.write go in the asp code?

neil


dparsons February 26th, 2007 09:01 PM

It would be after what action occurs that the page needs to refresh so say a row gets inserted into a database then the frame needs to redirect the pesudo code would be:

//Database connection
//process
//close database
//write out javascript

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429

neil.abachi07 February 26th, 2007 09:07 PM

so response.redirect would be replaced by response.write?

neil


dparsons February 26th, 2007 09:08 PM

Yes.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429

neil.abachi07 February 26th, 2007 09:08 PM

lovely

ta


dparsons February 26th, 2007 09:12 PM

So, just out of curiosity, have you been learning anything form this thread that has spanned 60+ posts? =P

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429

neil.abachi07 February 26th, 2007 09:13 PM

where the 'page.asp' goes, can i put something along the lines of rec('redirect')?


dparsons February 26th, 2007 09:20 PM

what is rec('redirect')??

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429


All times are GMT -4. The time now is 09:06 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.