Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to do paging and following is the code for page 2:

if (this.PreviousPage != null)
{
TextBox TextBox1 = (TextBox)this.PreviousPage.FindControl("TextBox1");
Calendar Calendar1 = (Calendar)this.PreviousPage.FindControl("Calendar1");
Label1.Text = Convert.ToString("Hello {0}!!!! u have selected date as {1}" + TextBox1.Text.Trim() + Calendar1.SelectedDate);
}

it does not display the label text and also if i try remove the if() then it gives the error "Object reference not set to an instance of an object."
Please help
Posted

1 solution

Cross paging is retarded. Don't use it. Make both pages controls hosted on the same page. As it stands, you're clearly not doing it right, based on code you did not show us.
 
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