QueryString for redirection!

I used the query string parameter to redirect from Page 1 to page 2. From page 2, I wanted to redirect it to page 1. What should be the condition for checking if querystring is used ?? Please help me! Thanks guys!

+3
source share
4 answers

Ram, this is my interpretation of what you wanted: if a user accesses page2 because of a redirect from Page 1, the user will be redirected automatically to the page. If the user accesses Page2 directly (without visiting Page1), the user will remain at Page2 (not redirected to page 3).

If so, inside page1 you can set the redirection ("Page2.aspx? Previouspage = page1"), then in Page2, inside the Page_load method, check if there is a sequence of requests, if the previous page exists and is equal to "page1", redirect to the page 3, otherwise do nothing, and the page will be displayed.

0
source

You might want to parse the HTTP_REFERER and see if the page was called from Page 1. Basically, you should create a redirect based on the value of HTTP_REFERER. In C #, a value is available using the following:

Page.Request.ServerVariables("HTTP_REFERER")
0
source

- 2 .

, ( 5 - , , - , , , ). Page 1 3. - , 1 Page 3, , ; server.transfer 2, , 1 → 2 → 3, 1 → 3. URI, , , 1.

, . 1, , . 3, . , , , . 2? , ( , , , , - - ), , , .

0

Perhaps I do not understand this right .. but why not redirect directly from page 1 to page 3?

0
source

Source: https://habr.com/ru/post/1758775/


All Articles