Aleks
asked on
redirect to prev page
I am using ASP Classic.
I am currently using the script below on a page that has a stored procedure. It redirects to a specific page.
<script language="javascript">
window.location.href="Inde x.asp";
</script>
I need to tweak it so that it redirects to the PREVIOUS page.
Right now I have two pages that go to this one and because the redirect is fixed I need to pages to go back to the correct previous page.
Hope that makes sense.
I am currently using the script below on a page that has a stored procedure. It redirects to a specific page.
<script language="javascript">
window.location.href="Inde
</script>
I need to tweak it so that it redirects to the PREVIOUS page.
Right now I have two pages that go to this one and because the redirect is fixed I need to pages to go back to the correct previous page.
Hope that makes sense.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you are using a server side language, why would you use javascript? If your are hitting your SP via a javascript ajax call, then using js to go back makes sense. If your user is directed to a page (even if they don't "see" it) by your asp code, then you would probably be better off using response.redirect.
<%
set Conn = Server.createObject("ADODB.Connection")
Conn.open(my_connection_string)
set Cmd = Server.createObject("ADODB.Command")
set Cmd.activeConnection = Conn
Cmd.commandType = adCmdStoredProc
':
' stored proc code
':
set Cmd.activeConnection = nothing
set Cmd = nothing
Conn.close()
set Conn = nothing
' now redirect
response.redirect("my_new_page.asp")
%>
ASKER
Sorry forgot to click accept.
ASKER