I have a form which collects part of the data and posts this to another page. The other page completes data collection and sends it to the database.
I have used Page.PreviousPage.FindControl to get the members of the first page. The second page has some controls which autopostback. Thus, when those controls are accessed, the previous page is lost and I get a null error message.
You can use hiddenFields or sessions for this requirement...one second page first get all the first pages data and store it in hidden fields...then in postback second page, now gather all first pages data from hidden fields and second page data from postback...then
insert it into database...
I would suggest you to use Wizard control rather than pages for this requirement...
Thanks for the answers. I made a few hidden textboxes to hold the data. When the other control posted back, I caught the exception.
Simple now I come to think of it :)
MM92
Member
2 Points
2 Posts
PreviousPage with Autopostback
Mar 01, 2012 01:00 PM|LINK
Hi,
I have a form which collects part of the data and posts this to another page. The other page completes data collection and sends it to the database.
I have used Page.PreviousPage.FindControl to get the members of the first page. The second page has some controls which autopostback. Thus, when those controls are accessed, the previous page is lost and I get a null error message.
What can I do in this case? I am using C#
kedarrkulkar...
All-Star
34421 Points
5534 Posts
Re: PreviousPage with Autopostback
Mar 01, 2012 01:14 PM|LINK
on second page load, read values using Page.PreviousPage.FindControl and store these values in session or viewstate
on subsequent calls/postback read values from session/viewstate variables...
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
ramiramilu
All-Star
95463 Points
14106 Posts
Re: PreviousPage with Autopostback
Mar 01, 2012 02:54 PM|LINK
You can use hiddenFields or sessions for this requirement...one second page first get all the first pages data and store it in hidden fields...then in postback second page, now gather all first pages data from hidden fields and second page data from postback...then insert it into database...
I would suggest you to use Wizard control rather than pages for this requirement...
Thanks,
JumpStart
MM92
Member
2 Points
2 Posts
Re: PreviousPage with Autopostback
Mar 01, 2012 05:47 PM|LINK
Thanks for the answers. I made a few hidden textboxes to hold the data. When the other control posted back, I caught the exception.
Simple now I come to think of it :)