akohan
asked on
Null object
Hi,
I'm developing a web application, where it has few stages to process an order. There is an object as paymentInfo from PaymentInfo class (in step 3) and I need to use it in step 4. How can I access paymentInfo object from the last phase (step 4)?
The problem is that when I declare an object such as:
PaymentInfo myobj = new PaymentInfo();
I see myobj has null value.
Any help is appreciated.
Regards,
ak
Not sure how your stages are setup, but it looks like you need to pass your object to the next phase. You need to send myObj to the next phase using whatever mechanism starts phase 4. Your myObj is null because you're initializing a brand new PaymentInfo object.
ASKER
that is right but temporary I need to pass credit card info and saving it into session is not a safe way. Any comments on this?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, I do have SSL.
Do keep in mind, though, that whatever you decide to store in session, every user will have their own session. If you plan to store large objects, saving them to a DB may be a more logical choice.
ASKER
Thanks
On Step 1:
PaymentInfo myobj = new PaymentInfo();
Session["PaymentInfo"] = myobj;
On the following steps:
PaymentInfo myobj = (PaymentInfo)Session["Paym
More info on Session:
http://msdn.microsoft.com/en-us/library/ms178581.aspx
I hope this helps.