Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back To certain page

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hello....
who knows the code to make the page close and go page to certain page.... the same concept to back button, but it is automatic, without have to press the back button.

thanks
 
Hi.

Try the following:

Response.Redirect("yourPage.html");

KIRI
 
Automatic when?

If it is not when the page is loading then Response.redirect will not work.

Use Javascript to achieve this effect.
Wushutwist
 
Hi there

If you have html output for your page you can Response.Write or just insert the following:

<meta http-equiv=&quot;Refresh&quot; content=&quot;5; URL=http://www.yourpage.com&quot;>

the content is the time the page waits to refresh so if u want it to happen straight away set it to &quot;0&quot;.

Justin.
 
this little <meta> tag works very well indeed. I was wondering if there is a way you could use it to simply redirect the browser to a page inside your site, instead of using the full blown URL, in other words, can you do something like:

<meta http-equiv=&quot;Refresh&quot; content=&quot;5; URL=mypage.html&quot;;>.

I tried this, but it didn't work, but maybe i just have the wrong syntax. Does anyone know for certain? How much more water would there be in the ocean if it weren't for sponges?
 
Response.Redirect (Request.ServerVariables(&quot;HTTP_REFERER&quot;))

 
just reread your initial question, and if you mean you have opened a new window, and want to close that window and return to the originating page, then the following javascript will do the trick for you:

<script language=&quot;javascript&quot;>
self.opener.location.reload();
self.opener.focus();
self.close();
</script>

else, if you need to return to a page that this page came from, then you would have an If Then clause where you would include the Response.Redirect to the HTTP_REFERER which is the URL of the page you came from.
 
history.go(-1);

is the exact javascript equivalent to the browser's back button.
penny.gif
penny.gif
 
no, i meant that after the asp page processes the user form input, you get a screen that says &quot;thanks!&quot; and it waits for 5 seconds and then transferrs to index.html (or any other page within my site for that matter), without having to reference it by saying Does that make sense? How much more water would there be in the ocean if it weren't for sponges?
 
i'm sorry, scroce, i was answering discusmania's initial question......
 
You could try

%><META HTTP-EQUIV=&quot;REFRESH&quot; CONTENT=&quot;25;URL=index.asp&quot;><%

this waits 25 seconds then retruns control to the index.asp page..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top