Last Updated : Jan 1, 2023
Here, below is given an example how to use response.redirect with help of codes. Let us first understand its syntax.
Where url is manadatory whereas status is optional. Let us see an example below.
We will discuss them in next articles. But let us see how to use above all using one from them.
- For this first of all we here create a basic structure of html. For this we use html, head, title and body with script tag. We hope you know about the basic structure of html and which html tag is used for which concept.
- Now, as we see that here inside body, we create two heading tags. In first one this is heading tag of first type whereas another is heading tag of second type.
- The most used way is to use window.location methods. We as already say that window.location methods are discussed briefly in next tutorials. One thing more, that when you load this page you automatically redirected to another page which we use in our script tags.
- We can also use this for redirection on button click, text and many various ways are to use this. Here is one assignment for you and that is with the help of this article, you have to use response.redirect method. You can also refer to example given above to see how to use this method.