I want to use a string that I have been using in one aspx.cs file over to another. I know this is easy, but how do I go about doing that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it in a query string. On your first page:
and on the second page
This method will allow your users to see what you are passing to a second page. Alternatively you can place it in session object. To place it use:
and to get it back use:
As a third alternative, you can use Server.Transfer. Use this method if you want to go to the second page on the server side. But notice that your user will continue to see the url of the first page on address bar.
On page 1:
On page 2: