Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a method similar to Response.Redirect that will send variables to the destination page other than using a query string or the post method?

0
Posted

Is there a method similar to Response.Redirect that will send variables to the destination page other than using a query string or the post method?

0

Server.Transfer preserves the current page context, so that in the target page you can extract values and such. However, it can have side effects; because Server.Transfer doesnt’ go through the browser, the browser doesn’t update its history and if the user clicks Back, they go to the page previous to the source page. Another way to pass values is to use something like a LinkButton. It posts back to the source page, where you can get the values you need, put them in Session, and then use Response.Redirect to transfer to the target page. (This does bounce off the browser.) In the target page you can read the Session values as required. Refer to Passing Values Between Web Forms Pages for more information.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123