Link to home
Start Free TrialLog in
Avatar of Steve Bohler
Steve BohlerFlag for United States of America

asked on

Response.redirect and specify target

Hello,

In Classic ASP, I have a redirect such as:

Response.Redirect LOGINPAGE & "?from=" &Server.URLEncode(strURL)

Our site has frames and the code as written will perform this redirect within the frame it's called, but I want it to redirect to the TOP target (the whole page).

Is this possible?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can try 'target=_parent', which opens the page in the parent frame.
Avatar of Steve Bohler

ASKER

Could I use Javascript instead, like:

<script type="text/javascript">
          
    window.location='<%=LOGINPAGE & "?from=" &Server.URLEncode(strURL) %>'

           </script>
Could I use Javascript instead, like:

<script type="text/javascript">
           
    window.location='<%=LOGINPAGE & "?from=" &Server.URLEncode(strURL) %>'

           </script>

only if the page that's calling the script is the frame you want to go to login.asp. also keep in mind that you'll want to add some conditional if statement, otherwise it'll always go to login.asp in that current form
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, it's in a conditional statement. Is there any problem with that Javascript syntax, other than missing top.location?
the syntax is correct, except for what you mentioned, yes