View Full Version : how to use method Redirect???
jeena
05-06-2003, 05:51 AM
hi,
i'm suppose to redirect a particular page to another page.I'm aware that i can use the Response.redirect("thepage.asp") but i need to know if i should use it after the "Next" button function in my coding or before....
Welcome here.
I didn't quite understand that. but i need to know if i should use it after the "Next" button function in my coding or before....
Response.redirect is a server sided redirect. Nothing is shown to the client. No buttons or whatever. You don't use it to let the client choose a page. Normally, you use it to evaluate something, and send the user somewhere depending on the evaluation. Like
if request.form("username") = "fake" then
response.redirect("adminlogon.asp")
else
response.write("Welcome")
other code
end if
If the parser encounters a response.redirect, it will stop executing your script (the control of flows like if then else etc are checked and loaded before the script actually is processed) and load the page you redirect to.
so if you would have:
response.redirect("whatever.asp")
response.write("whatever")
then the user will not see this 'whatever'. He'll see the results of whatever.asp
jeena
05-07-2003, 01:51 AM
from this page A, i need to go to page B,and this is suppose to happen when i click the Next button...But i don't seem to get to the next page.....PLEASE HELP...
what do i do????
JustAsking
05-07-2003, 02:54 AM
Welcome jeena,
Usually when posting a question it is good practice to also include the code, or some, where you are having difficulty.
In what manner are you using the next button? Following are two ways you may be trying to use:
1. To process results within a form, to do this use the form tag like this: <form name="form1" method="post" action="thepage.asp">
2. Or just as a normal button with an onlick event: <input type="button" name="nextpage" value="Next" onclick="location.href='thepage.asp';">
Hope this helps, if you're not sure ask and maybe post some code.
jeena
05-07-2003, 07:48 AM
thnx 2 was the answer to my question thax a lot.....:)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.