You can add if you want to allow user to add product in to the Cart with out authente in to the site by maintaining that value in to the Session.
using Browser's Session.
use string sesssion = Session.SessionID;
you can get that Perticular user's browser Session id.
Enjoy
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Yes you can, just check the the user is authentictaed or not on Page_Load. If user is authenticated then user can add item on the Cart.
Or
On the click event of the Perticular Item check the User is authentictaed or not. If the User is authenticted then it will add in cart and if not authenticted then show the messgae that "Please Login."
Enjoy
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
zielony
Member
221 Points
410 Posts
Does shopping cart use sessions ?
Jul 15, 2009 07:39 AM|LINK
When user isn't registered he can add items to shopping cart or not ? Because I can't find in this project nothing with sessions.
vora_bhaumik
Contributor
2043 Points
340 Posts
Re: Does shopping cart use sessions ?
Jul 15, 2009 06:59 PM|LINK
HI,
You can add if you want to allow user to add product in to the Cart with out authente in to the site by maintaining that value in to the Session. using Browser's Session.
use string sesssion = Session.SessionID;
you can get that Perticular user's browser Session id.
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Regards,
Bhaumik
zielony
Member
221 Points
410 Posts
Re: Does shopping cart use sessions ?
Jul 15, 2009 07:23 PM|LINK
But now only loged on/authenticated users can add items to cart or not ?
vora_bhaumik
Contributor
2043 Points
340 Posts
Re: Does shopping cart use sessions ?
Jul 16, 2009 04:00 AM|LINK
Hi,
Yes you can, just check the the user is authentictaed or not on Page_Load. If user is authenticated then user can add item on the Cart.
Or
On the click event of the Perticular Item check the User is authentictaed or not. If the User is authenticted then it will add in cart and if not authenticted then show the messgae that "Please Login."
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Regards,
Bhaumik
zielony
Member
221 Points
410 Posts
Re: Does shopping cart use sessions ?
Jul 16, 2009 04:38 AM|LINK
And before placed an order, items in cart are saved in session or in database ?
vora_bhaumik
Contributor
2043 Points
340 Posts
Re: Does shopping cart use sessions ?
Jul 16, 2009 05:45 AM|LINK
Hi
Check both the links such a nice Example ,
http://www.c-sharpcorner.com/UploadFile/ShrutiShrivastava/ASPNetShoppingCart11262005063508AM/ASPNetShoppingCart.aspx
http://www.codeproject.com/KB/user-controls/shopcart.aspx
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Regards,
Bhaumik