Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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-Jan-13 18:57pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 Maciej Los 475
1 OriginalGriff 410
2 Sascha Lefévre 289
3 CPallini 285
4 Sergey Alexandrovich Kryukov 274
0 Sergey Alexandrovich Kryukov 9,897
1 OriginalGriff 9,395
2 Peter Leow 5,162
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,036


Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2015
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