Click here to Skip to main content
15,880,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have 2 forms a and b . form a captures users requirements. form b displays date entered by user in page a / confirming it before storing it into an database.can anybody tell me how to share data(or values of a controls) between 2 page i.e page a and page b.
thank u
anoop
Posted
Comments
member60 2-Nov-11 2:58am    
use google frequently , have u tried for the solution ?

 
Share this answer
 
Comments
P.Salini 2-Nov-11 2:40am    
please give reason for down vote
for data sharing in ASP.NET you can find various state-full objects. for your purpose it will be better to use session object.
if you only require to pass date to next page. write following on page 1

C#
Session["page1_date"] = pg1_lbl_date.Text;


now on load of page2 you can check that if the page is not post back and session is not empty then get date from session and display on page2.
i.e


C#
private string page1_date_value = stirng.Empty;
Page_Load(object sender, EventArgs e)
{
  if(Session["page1_date"] != null)
  {
    page1_date_value =  Session["page1_date"];

  }
  
}


this way you can get value on page2.
other than using session you can study QueryString as well.
 
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