How to use PostBackUrl in pages that currently rely on Response.Redirect (heavily)?
I am changing some existing ASP.Net pages. Those pages heavily rely on Response.Redirect. Now I need to carry data between pages, and one obvious option is to change each Response.Redirect to Server.Transfer. This way the modification is very straightforward. However the problem is that Server.Transfer does not change the URL in the address bar, which some see as a problem.
The other option is to rely on PostBackUrl, but the modification seems to be extensive in some cases. For example, say I have two pages P1 and P2, both lead to page P3. P1 has a button B1. In the existing code, when B1 is clicked, it executes a chunk of code (C1) and in the end of C1, it does Response.Redirect. Same with P2, which has a button B2 and only calls Response.Redirect after a major chunk of code (C2) is executed.
Now, if I set PostBackUrl for both B1 and B2 to P3. Where is the best new home for C1 and C2 to reside?
|