why we can't access the previous page variable value by using the properties

Posted by Er.deepakdalal under C# on 4/29/2010 | Views : 1970 | Status : [Member] | Replies : 4
Hi friends


why we can't access the previous page variable value by using the properties in c# in asp.net whether in the windows we get easily the one form value to other using the same properties funda




Responses

Posted by: Raja on: 4/29/2010 [Member] Starter

Up
0
Down
Read http://www.dotnetfunda.com/articles/article867-how-to-pass-values-from-one-page-to-another-page-without-state-management-t-.aspx article to know how to access previous page variable to another page.

Thank you

Regards,
Raja, USA

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 4/30/2010 [Member] Bronze

Up
0
Down
By using the method
PreviousPage.FindControl("Control")

we can find the value of the previous page values

Thanks
Pavan Kumar
Mark Answer if this fits the need

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naveenmanam on: 4/30/2010 [Member] Starter

Up
0
Down
 

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 100;
left: 148px; position: absolute; top: 101px" Text="Calling Second Page using Crosspage" TabIndex="2" PostBackUrl="~/CrossPagePosting2.aspx" />
<asp:TextBox ID="TextBox2" runat="server" Style="z-index: 101; left: 146px; position: absolute;
top: 62px" TabIndex="1"></asp:TextBox>
<asp:Label ID="lbl" runat="server" Style="z-index: 102; left: 52px; position: absolute;
top: 65px" Text="Last Name"></asp:Label>


NaveenKumar

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shikharkum on: 5/5/2010 [Member] Starter

Up
0
Down
try using query strings or the page.findcontrol("control id").


Your problem will be solved.

The reason why you can't access the previous page variables is the once a page is navigated off, its instance id destroyed from the server.

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response