Solved

Opening an asp page with button click for specific frame

Posted on 2001-06-29
5
220 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Classic ASP - cannot get to correct path 17 73
Classic ASP + JS 4 95
rebind a grid after user clicks on node in treeview 1 35
Button to go back 3 25
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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