Click here to Skip to main content
15,896,466 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a section in my website where the user has to follow a three step process:

register ---> payment ----> receipt generation

each part is on a different webpage. However, they are all linked together. Without payment, a registration cannot be successful. Prior to my situation, after the register page, i was saving the data into the db and then proceeding to the payment section. However, i realized that this could lead to issues. if user suddenly closes the window at payment, and does not save the payment, or the computer shuts down, the user will have wrong info stored in the db. Registered without payments/receipt. In order to fight this issue. I created a class and created objects from it. I passed each object across to the next page using the "PreviousPage" directive and class property system. It worked fine, the object would be read and stored in a new class object and i would write more data on it and pass it on to the next page. Then before receipt generation, i would save entire data to the db. However, the problem being caused is Post back. If post back occurs, i loose all my objects data and cannot obviously access the previouspage as its a post back and all data is lost. So how do i go about this? is there any other efficient method? i do not want to use sessions as it seems the session is expiring and refreshing too soon. I tried to change the session timeout property but it doesn't seem to make any changes. So i do not want to rely on session, as i cannot afford to loose the data. What other options do i have? I thought of creating temp tables in my db, but don't think that would be a good method. Kindly advise!
Posted

1 solution

Once you have values on one page & if you want to save it across post back you can use view-state. You said that you have passed object with values on the next page. Now on page load save it in view-state if not post back. & when the payment is complete read data from view state.
 
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