Solved

Opening an asp page with button click for specific frame

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Writing comments on <p></P> or paragraph 2 21
Insert Button on a table 16 45
Validating Date Part2 2 25
PHP encrypted string and passing to a ASP Page 12 37
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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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