judsonmusic
asked on
Response.Redirect to an iframe???? Target?????
i have this code
<%Response.Redirect("thank you.htm")% >
it opens a blank window, where i need it to display the thankyou pafe in an iframe
How do I show a target???
Thanks
<%Response.Redirect("thank
it opens a blank window, where i need it to display the thankyou pafe in an iframe
How do I show a target???
Thanks
ASKER
ok, let me rephrase.
I have a main page, with an iframe already on it.
The normal way is simply target="iframe"
I have to use an asp because os the response.redirect.
Is that what your code will do is I replace mine with it???
Thanks
Judson
I have a main page, with an iframe already on it.
The normal way is simply target="iframe"
I have to use an asp because os the response.redirect.
Is that what your code will do is I replace mine with it???
Thanks
Judson
ASKER
here is the current code:
MM_redirectLoginSuccess="m embers.asp "
i need the members page to open in an iframe called iframe
Thanks
Judson
MM_redirectLoginSuccess="m
i need the members page to open in an iframe called iframe
Thanks
Judson
the simplest way would be to put the response.redirect into the page you are already loading in the current iframe.
ASKER
How would that work???
A user is basically submitting an asp form for login, once it is sucessful I want the page to open in a iframe not a new window.
MM_redirectLoginSuccess="m embers.asp "
If my code has this?????????????????? above
How can i change the "members.asp" part to load in an iframe that already exists????????????
like target="iframe"
A user is basically submitting an asp form for login, once it is sucessful I want the page to open in a iframe not a new window.
MM_redirectLoginSuccess="m
If my code has this?????????????????? above
How can i change the "members.asp" part to load in an iframe that already exists????????????
like target="iframe"
You cannot use target in response.redirect as it is server side code where as frames and windows are client-side concepts. You have to some JavaScript code to achive what you want.
Check below posts, hope it will help
http://www.developersdex.com/gurus/code/647.asp
http://classicasp.aspfaq.com/forms/how-do-i-change-the-target-frame-or-window-of-a-response-redirect.html
rdonline1
Check below posts, hope it will help
http://www.developersdex.com/gurus/code/647.asp
http://classicasp.aspfaq.com/forms/how-do-i-change-the-target-frame-or-window-of-a-response-redirect.html
rdonline1
does your page already have an iframe in it?
what page is in the already existing iframe?
ASKER
Yes, I have a parent page with and iframe in it.
Very simple setup
Very simple setup
>>
Comment from kevp75
Date: 12/11/2006 09:20AM EST
Your Comment
what page is in the already existing iframe?
<<
Comment from kevp75
Date: 12/11/2006 09:20AM EST
Your Comment
what page is in the already existing iframe?
<<
ASKER
The main page points to a page called news.asp in the ifame
When you go to the website you se news in the iframe as default.
I want to when a user logs in on the main page, that it opens the members.asp page in the iframe, not in a new window.
How do I target the iframe in asp???
Judson
When you go to the website you se news in the iframe as default.
I want to when a user logs in on the main page, that it opens the members.asp page in the iframe, not in a new window.
How do I target the iframe in asp???
Judson
PUT THE REDIRECT IN news.asp, based on the session or cookie variable if the user is logged in
ASKER
What will that do??????
Can you show me the code??????? Please be specific.
Can you show me the code??????? Please be specific.
yes that will do...actually, if you still want the news.asp page to be able to be displayed, then you'll have to do things a bit different;y.
on news.asp put
<%
if request.querystring("redir ") = "mem" then
response.redirect("members .asp")
end if
%>
in your login page after your login processing code put:
<%
response.redirect("/thepag ethathasyo uriframeon it.asp?red ir=mem")
%>
on news.asp put
<%
if request.querystring("redir
response.redirect("members
end if
%>
in your login page after your login processing code put:
<%
response.redirect("/thepag
%>
ASKER
ok, Ill try that tonight and get back to you.
thanks
Judson
Can you explaiun each line and how the page in the iframe sees it??
Also can you rewrite the code based on my main page being: mainpage.asp
And my new.asp page being loaded in the iframe by deafault??????
The iframe is calle "iframe""
Thanks for your help in advance,
Judson
thanks
Judson
Can you explaiun each line and how the page in the iframe sees it??
Also can you rewrite the code based on my main page being: mainpage.asp
And my new.asp page being loaded in the iframe by deafault??????
The iframe is calle "iframe""
Thanks for your help in advance,
Judson
You will have somewhere
Response.Redirect MM_redirectLoginSuccess
Change that to
Response.Write "<script>top.frames['IFram eNameHere' ].location .href = '" & MM_redirectLoginSuccess &"';</script>"
Make sure to change IFrameNameHere to whatever name you have.
Response.Redirect MM_redirectLoginSuccess
Change that to
Response.Write "<script>top.frames['IFram
Make sure to change IFrameNameHere to whatever name you have.
ASKER
amit, that dos not work for some reason.
Can you be more specific????
here is what I am replacing
MM_redirectLoginSuccess="m embers.asp "
the iframe is called iframe
Can you be more specific????
here is what I am replacing
MM_redirectLoginSuccess="m
the iframe is called iframe
ASKER
I also found this:
Response.Redirect(MM_redir ectLoginSu ccess)
can you tell me what to do??? I've tried everything~
Response.Redirect(MM_redir
can you tell me what to do??? I've tried everything~
Line
MM_redirectLoginSuccess="m embers.asp "
should remain as it is.
Change
Response.Redirect(MM_redir ectLoginSu ccess)
to
Response.Write "<script>top.frames[0].loc ation.href = '" & MM_redirectLoginSuccess &"';</script>"
MM_redirectLoginSuccess="m
should remain as it is.
Change
Response.Redirect(MM_redir
to
Response.Write "<script>top.frames[0].loc
ASKER
That doesnt work either.
The login is on the mainpage.
I want when they login to open the members page in the iframe.
where in the above code does it list my iframe?????? again the name of it is "iframe"
Thanks
The login is on the mainpage.
I want when they login to open the members page in the iframe.
where in the above code does it list my iframe?????? again the name of it is "iframe"
Thanks
>>where in the above code does it list my iframe
I did not get that. What happens when the login button is pressed and login is successful?
I did not get that. What happens when the login button is pressed and login is successful?
ASKER
with the existing code, it opens the members.asp page new window. I want it to post the members.asp page in the iframe
With your code, it says this page cannot be displayed in a new window.
With your code, it says this page cannot be displayed in a new window.
ASKER
how can I make it point to my iframe???
You will have to show more code. There are several ways this could happen. If you generated code with DW, you probably have target set. Find out the form tags that has your login submit button. It would look like
<form ... target="_blank">
change that to
<form ... target="iframe">
if that doesn't work for you, show us the complete code of login page.
<form ... target="_blank">
change that to
<form ... target="iframe">
if that doesn't work for you, show us the complete code of login page.
ASKER
This is the line of code that I need to change:
MM_redirectLoginSuccess="m embers.asp "
It works just fine useing the log in user function in dreamweaver. However, it is opening the page in a whole new window.
I want to tell it to open in an iframe.
here is the login code.
here is the login user script. Again, keep in mind there is a content ifram in the middle of the page called "iframe"
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/IBSDatab ase.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("U RL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request. QueryStrin g)
MM_valUsername=CStr(Reques t.Form("us ername"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="m embers.asp "///////// ////////// ////////// ////////// ///////Thi s is the problem.////////////////// ////////// ////////// ////////// ////////// ///
MM_redirectLoginFailed="so rry.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_fla g)
MM_rsUser.ActiveConnection = MM_IBSDatabase_STRING
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM ibsinfo.IBS_MEMBERS WHERE username='" & Replace(MM_valUsername,"'" ,"''") &"' AND password='" & Replace(Request.Form("pass word"),"'" ,"''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorizat ion") = CStr(MM_rsUser.Fields.Item (MM_fldUse rAuthoriza tion).Valu e)
Else
Session("MM_UserAuthorizat ion") = ""
End If
if CStr(Request.QueryString(" accessdeni ed")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("acces sdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redir ectLoginSu ccess)//// ////////// ////////// ////////// ////////// ////////// This line tells it to do the above "members.asp"///////////// ////////
End If ////////////////////////// but noe in an iframe currently. how do I fix that???///
MM_rsUser.Close
Response.Redirect(MM_redir ectLoginFa iled)
End If
%>
MM_redirectLoginSuccess="m
It works just fine useing the log in user function in dreamweaver. However, it is opening the page in a whole new window.
I want to tell it to open in an iframe.
here is the login code.
here is the login user script. Again, keep in mind there is a content ifram in the middle of the page called "iframe"
--------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/IBSDatab
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("U
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.
MM_valUsername=CStr(Reques
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="m
MM_redirectLoginFailed="so
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_fla
MM_rsUser.ActiveConnection
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM ibsinfo.IBS_MEMBERS WHERE username='" & Replace(MM_valUsername,"'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorizat
Else
Session("MM_UserAuthorizat
End If
if CStr(Request.QueryString("
MM_redirectLoginSuccess = Request.QueryString("acces
End If
MM_rsUser.Close
Response.Redirect(MM_redir
End If //////////////////////////
MM_rsUser.Close
Response.Redirect(MM_redir
End If
%>
This is all server side code. Do you have another page where login/password input boxes are? If so post that code. The new window is opened before this code is executed in the server side so we need to make changes in the code that opens the new window. This code doesn't open the new window.
ASKER
Ummmmm, where would that code be????????
Are you saying there is some code in there that I dont know about????
Where would dreamweaver place it by default????
I am confused.
Are you saying there is some code in there that I dont know about????
Where would dreamweaver place it by default????
I am confused.
ASKER
This is my form:
<form ACTION="<%=MM_LoginAction% >" method="POST" name="form1">
<p><strong>Quick Login</strong><br>
username<input name="username" type="text" id="username" size="14"><br>
password<input name="password" type="password" id="password" size="14">
<br>
<input type="submit" name="Submit" value="Login">
</form>
Nithing else on the whole page has anything to do with this .
<form ACTION="<%=MM_LoginAction%
<p><strong>Quick Login</strong><br>
username<input name="username" type="text" id="username" size="14"><br>
password<input name="password" type="password" id="password" size="14">
<br>
<input type="submit" name="Submit" value="Login">
</form>
Nithing else on the whole page has anything to do with this .
ASKER
When I execute this code on a page inside of the iframe, It works perfectly. It opens the members page.
go to this site:
www.ibsinfo.net
Go to signup, make an test account
The login that doesnt work is on the left.
However, If you go to member login, you can log in with the test account in the iframe and it does work.
Now what???? They both are using the same code.
go to this site:
www.ibsinfo.net
Go to signup, make an test account
The login that doesnt work is on the left.
However, If you go to member login, you can log in with the test account in the iframe and it does work.
Now what???? They both are using the same code.
ASKER
OK, I FOUND A WAY BUT THERE IS ONE PROBLEM!!!!!!!!!!!!!!!!!!! !!!!!!!!1
I put target="iframe" in the form tag.
the problem is that the username and password sticks in the form boxes, how can I make this refresh?????
Judson
also, if there is indeed an asp work around, I would liek to know it.
Judson
I put target="iframe" in the form tag.
the problem is that the username and password sticks in the form boxes, how can I make this refresh?????
Judson
also, if there is indeed an asp work around, I would liek to know it.
Judson
ASKER
ok, I tried this but it refreshes the iframe too.
I would love to know a solution.....
I would love to know a solution.....
ASKER
I figured it out.
<body OnLoad="window.parent.docu ment.forms [0].reset( )">
Thsi works fine.
I will give you a c for your help as apposed to a refund.
Thanks
Judson
<body OnLoad="window.parent.docu
Thsi works fine.
I will give you a c for your help as apposed to a refund.
Thanks
Judson
ASKER
Actually after looking through the posts, none of it was even close. Im sorry.
Judson
Judson
Refund is fine with me.
ASKER
Thanks for your understanding .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<%
response.write("<iframe src=" & chr(34) & "thankyou.html" & chr(34) & " width=100 height=100></iframe>")
%>
-Brian