Redirecting the browser

While in developing web applications, it sometimes becomes necessary to redirect the user (or browser) to a particular page of your application. For instance, when the user enters the correct login credentials to access your web application, you may redirect that user to an entry page of your web application. If, however, the input login information is incorrect, you may redirect the user back to login page. The response.redirect statement can be used to send the user to another page. In the following code, we

response.redirect "http://www.scriptingmaster.com/html/html.asp"

send the user to html.asp of the Scripting Master's web site. The html.asp is the destination page and the page that contains the above code is the referral page. Once the above codes executes, the user will immediately be sent to the destination page. Note how we included the entire URL of the destination page in the redirection statement: the website address, the folder/directory, and the page itself. It is not, however, necessary to provide the domain name and folder or directory path if both of your destination and referral pages are within the same folder. Suppose we have a folder named asp and it has both of our pages: the referral page (login.asp) and the destination page (members_only.asp). In this case, our redirect statement would just be (in login.asp):

response.redirect "members_only.asp"