Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to go back to previous page and keep all entered infomation in asp.net please help me as soon as possible
Posted
Comments
P_Dash 18-Feb-13 11:57am    
Solution Improved.
Chk Out.

We have a lot of State Management techniques.
Use any of Client Side/Server Side State Management techniques to achieve your goal.

Here is the Code to Work with Cross Page postback:
The Following is the Code for Form1:
Here I'm using a LinkButton to go to 2nd Form.
ASP.NET
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/CrossPagePostback_Form2.aspx">Go To Form2</asp:LinkButton>
        <br />
        <br />
        <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>


Now in 2nd Form I'm just using a Label to Show the Value of TextBox present in 1st Form:
C#
protected void Page_Load(object sender, EventArgs e)
    {
        if (PreviousPage != null)
        {
            TextBox txtTest = (TextBox)PreviousPage.FindControl("txtTest");
            Label1.Text = txtTest.Text;
        }
    }


This is the Process to access data present in Previous Page using CrossPage Postback.
For better Understanding of CrossPage postback you ca refer the following link:
Cross-Page Posting in ASP.NET Web Pages[^]

Regards.
 
Share this answer
 
v3
Comments
[no name] 14-Feb-13 2:39am    
sir how to use Cross Page Postback can you please tell me
P_Dash 14-Feb-13 9:47am    
Lemme try it.
If getting successful, will surely post it.
i guess we can do it by setting enable view state property to true, and if it doesn't works you can go for session management technique i.e. if you want to transfer data from one form to another
 
Share this answer
 
You should store your previous page data in Cache.
Wikipedia : Cache (computing)[^]

Here is some ovservations:
MSDN : ASP.NET Caching Overview[^]
MSDN : ASP.NET Caching[^]
MSDN : ASP.NET Caching Features[^]

And also see:
ASP.NET - Data Caching[^]

--Amit
 
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