Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi frnds,

I have 3 pages in my project. am working on asp.net c# sql

I want to pass the textbox value between these pages
I want to see first textbox value in other two pages using label

I want to use query string. not Sessions

am getting the first page textbox value in page2 but not in page3

This is my code.

First Page -> TxtProjectName
Response.Redirect("CreateTicket.aspx?PName=" + TxtProjectName.Text);

second page ->
C#
lblProjectName.Text = Request.QueryString["PName"];
        lblProjectName.Visible = true;



In third page..am unable to display the textbox value.

Please help.

THanks.
Posted
Comments
AnvilRanger 19-May-14 9:48am    
Are you passing the value from the 2nd page to the URL of the 3rd page in the query string?
Nirav Prabtani 19-May-14 9:55am    
what is error??
SRS(The Coder) 19-May-14 9:57am    
You have to pass the same value from 2nd page to the 3rd page as well in same way to get the value to be used in third page also.

C#
  lblProjectName.Visible = true;
lblProjectName.Text = Convert.ToString(Request.QueryString["PName"]);
 
Share this answer
 
SQL
Pass the label value of 2nd page to the 3rd page using query string. But I wonder why you don't want to use session. It will do simpler your code and you can access any page's value on any other page.
 
Share this answer
 
Do the same as you have done for the first 2 pages,
In your second page, may be on some button click:
Response.Redirect("page3.aspx?PName=" + lblProjectName.Text;

then in your page3.aspx page load
LabelPage3.Text = Request.QueryString["PName"];
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900