WebForms and timeouts / loss of session data

B

Billy Horne

Hi - I need to write a basic order page for our web site. It is very
straight-forward, in that we don't need a whole "shopping cart" system.
Instead we just need a list of products displayed with a quantity field, and
when they submit the form it then collects payment info, then they submit
again and it charges their card. I plan to use a third party component to
handle the credit card charging so that should be pretty easy.

My main concern is how to best make a simple web form that the users can use
to submit their orders. I have studied web forms and it looks ideal except
for one MAJOR catch - the posted back data seems to timeout after x minutes.

For example assume page 1 of the order form asks for quantities of each
item. Then that is posted back and they get the customer information page
next. Now, if they sit on that page for say an hour before doing anything
when they continue and submit the form I think all the previously posted
data is lost because the session times out, right? I assume I can bump the
timeout, but what if they go home for the night and continue the next day or
a long scenario like that?

With this in mind, it seems like the traditional approach of just using
regular home grown forms and managing posted data manually (i.e. the type of
approach taken with classic ASP) has a great advantage in this regard. Am I
right, or am I missing something? How can you best account for the
possibility of long delays between each postback?

Also while we are on the subject; can anyone recommend a sample that
demonstrates how to make a basic ordering system like this. Like I
mentioned above I am not looking for anything complex or anything that
allows them to browse and add items to a cart and all that. Just need to
have them say I want x of these, and x of those and here is my credit card.

Bill
 
C

Craig Deelsnyder

Hi - I need to write a basic order page for our web site. It is very
straight-forward, in that we don't need a whole "shopping cart" system.
Instead we just need a list of products displayed with a quantity field,
and
when they submit the form it then collects payment info, then they submit
again and it charges their card. I plan to use a third party component
to
handle the credit card charging so that should be pretty easy.

Yes, you'd need a home-grown solution. The problem with this scenario is
what about the pricing, etc. of the products I've selected? What if they
change either since I left the browser, or before I then end up checking
out? Or quantities, do you hold them for me, or could they get bought
while I'm gone? How do you handle that?

BTW, I've never done ecommerce or needed this 'perpetual session', so
that's the reason for the questions...

This may be some overkill, but I'm sure there's some pointers you can find
here:
http://asp.net/Default.aspx?tabindex=8&tabid=47
 
B

Billy Horne

Yes, you'd need a home-grown solution. The problem with this scenario is
what about the pricing, etc. of the products I've selected? What if they
change either since I left the browser, or before I then end up checking
out? Or quantities, do you hold them for me, or could they get bought
while I'm gone? How do you handle that?

These are good questions - thanks for asking. Our prices have not changed
in over a year so I am not concerned about a price change. We sell software
ESD so there is never a shortage or inventory to worry about. So there is
no need for me to worry about those things.
This may be some overkill, but I'm sure there's some pointers you can find
here:
http://asp.net/Default.aspx?tabindex=8&tabid=47

Thanks for the tip but definately overkill - no need for a whole shopping
cart app - just a simple step 1) pick your quantities and items from a list
on one page and submit, 2) enter your info and cc, 3) order confirmed.

Its hard to imagine that all the flexibility and power of webforms goes
right out the window if you need to make sure a user's session will not time
out between postbacks as they move from page to page in the order system,
like should they go to lunch in the middle or go home for the day and try
and continue the next day. I would think there is a better solution than
doing it the old-fashion class ASP way whereby you have the values passed in
via hidden form fields individually.

I was looking forward to the power of web forms and not having to worry
about all that myself, but its looking like I have to do it myself the hard
way. Bummer... Anyone have a solution for this that can still use
webforms?
 
S

Scott Allen

Hi Billy:
Its hard to imagine that all the flexibility and power of webforms goes
right out the window if you need to make sure a user's session will not time
out between postbacks as they move from page to page in the order system,
like should they go to lunch in the middle or go home for the day and try
and continue the next day.

It doesn't have to be that way if you keep session state in a
database, which I realize is asking a lot if you are trying to keep
the application as simple as possible. Still, the option exists and
it's easy to configure - no code required.
I would think there is a better solution than
doing it the old-fashion class ASP way whereby you have the values passed in
via hidden form fields individually.

Unfortunately this is the way the web works. Web forms do a nice job
of abstracting away this detail so you don't need to know this is
happening underneath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top