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

Platform: ASP.NET| Category: Basic

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.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.