Last post Mar 01, 2012 05:47 PM by MM92
Mar 01, 2012 01:00 PM|MM92|LINK
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#
Mar 01, 2012 01:14 PM|kedarrkulkarni|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...
Mar 01, 2012 02:54 PM|ramiramilu|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...
Mar 01, 2012 05:47 PM|MM92|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 :)