Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 16-Jul-12 20:47pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use PreviousPage to access that
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[^]
  Permalink  
v2
Comments
Sandeep Mewara at 17-Jul-12 2:10am
   
5! That would be best fit here based on whatever info shared.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 BillWoodruff 260
3 Shweta N Mishra 244
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 17 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100