Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m trying to access a textbox text from one page in another page. using server.Transfer("a.aspx",true), a.aspx is opening, but am unable to access textbox through Request["textBox1"]
Posted

You can use PreviousPage to access that
C#
TextBox txt = (TextBox)Page.PreviousPage.FindControl("textBox1");

More details can be found here: http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx[^]
 
Share this answer
 
v2
Comments
Sandeep Mewara 17-Jul-12 2:10am    
5! That would be best fit here based on whatever info shared.
The way you are trying to access the value of control from previous page is not correct.
As suggested, either you go with Previous Page concept OR you need to follow other state management techniues to access the textbox value.
Other suggestible ways would be:
1. Session
2. QueryString

Have a look at details of them here:
MSDN: ASP.NET State Management Overview[^]
State management in ASP.NET - 1[^]
ASP.Net State Management Techniques - 2[^]
 
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