Solved

Opening an asp page with button click for specific frame

Posted on 2001-06-29
5
219 Views
Last Modified: 2006-11-17
How do I instruct through asp response.redirect method to open a specific asp page in a specific frame target? I can do this with an <a>anchor but has never tried it with response.redirect or even vbscript.

Can you please help
Thanks
0
Comment
Question by:Freelancer
5 Comments
 
LVL 7

Expert Comment

by:weesiong
ID: 6237039
Freelancer,

<script>
window.frame1.location = "xxx.asp"
</script>

<script>
window.parent.location = "xxx.asp"
</script>

This is javascript :0

Regards,
Wee Siong
0
 
LVL 1

Expert Comment

by:anupkarade
ID: 6237090
hi
   you can use <a href> very well in this case
   
 Firstly give names to all your frames
  ex mainframe, rightframe, leftframe

code goes as follows:-
<a href="Yourpage.asp" target="mainframe">link</a>

this will help
                      regards
                      Anup        

0
 
LVL 1

Accepted Solution

by:
choroque earned 50 total points
ID: 6237166
You have to use client side javascript or vbscript.

<body>

<form name="myform">

</form>


<%'your asp code
if something then%>

<script language="javascript">
  myform.action = "mypage1.asp" ;
  myform.target = "myframetarget" ;
  myform.submit();
</script>

<%else%>

<script language="javascript">
  myform.action = "mypage2.asp" ;
  myform.target = "myframetarget" ;
  myform.submit();
</script>

<%end if%>

</body>
0
 
LVL 10

Expert Comment

by:makerp
ID: 6237244
if your form is calling a page and you want the results to appear in another frame simply set the TARGET="frame_name" in the <FORM> tag
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6237307
How do I change the target frame or window of a response.redirect?     (13,787 requests)
With client-side code, such as top.<target>.location.href= ...
ASP is on the server and does not "see" frames.
 
Instead of response.redirect, use code like this:
 
<%
    url = "http://wherever.com/
    response.write("<script>" & vbCrLf)
    response.write("parent.targetframename.location.replace('" & url & "');" & vbCrLf)
    response.write("</script>")
%>
 
 
Or this:
 
<%
    url = "http://wherever.com/
    response.write("<script>" & vbCrLf)
    response.write("parent.targetframename.location.href='" & url & "';" & vbCrLf)
    response.write("</script>")
%>
 
 
I prefer the replace() function because it doesn't muck up the history list. YMMV. I've also found that using the following syntax creates headaches on certain 3.0 browsers:
 
<%
    response.redirect("javascript:framename.location.href='wherever';")
%>
 
 
So I would avoid using that one unless you're in a controlled environment or you've tested it across your target audience.
 
If it is a form you're submitting to, you can use the following:
 
    <form method="post" action="page.asp" target="framename">
 
 
 
And if you want to open a new window, you can use:
 
<%
    url = "http://wherever.com/
    response.write("<script>" & vbCrLf)
    response.write("window.open('" & url & "');" & vbCrLf)
    response.write("</script>")
%>


If you'll accept my comment.. give points to wee siong also since he first mentionned client side script

fetched from aspfaq
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now