Solved

Opening an asp page with button click for specific frame

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
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/…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

17 Experts available now in Live!

Get 1:1 Help Now