Session State ArrayList In Shopping Cart?
May 1, 2010
I'm creating a shopping cart application and I'm having some issues with implementing a session state for my arraylist.
in my page load i declared
if (Session["Cart"] == null)
{
Session["Cart"] = new ArrayList();
}
else
{
ArrayList cart = (ArrayList)Session["Cart"];
}
to create the session if it doesn't exist yet.
then i have an event handler for a button to add items to the arraylist
protected void onClick_AddBooking(object sender, EventArgs e)
{
int ClassID = Convert.ToInt32(Request.QueryString.Get("Class_Id"));
ArrayList cart1 = new ArrayList();
cart1 = Session["Cart"];
cart1.Add(ClassID);
I'm essentially storing the class_ID then when the student confirms i'll store that to the DB and associate that ID with the Class Details.
View 1 Replies
Similar Messages:
Mar 8, 2011
i am currently storing my shopping cart in a datatable assigned to the session. but i wanted to know is it a good idea to store the GUID for the session shopping cart?
View 6 Replies
Jun 29, 2010
I m developing new shopping cart by using mvc2.and i have followed sample video store application posted in asp.net.my question is: What is the best way to keep shopping cart data.is it in db or a session.
View 3 Replies
Feb 5, 2011
I know there are a million questions out there on how to implement a shopping cart in your site. However, I think my problem may be somewhat different. I currently have a working shopping cart that I wrote back in the 1.1 days that uses ASP.NET session variables to keep track of everything. This has been in place for about 6 years and has served its purpose well. However, it has come time to upgrade the site and part of what I have been tasked with is creating a more, erm, user-friendly site. Part of this is removing updatepanels and implementing real AJAX solutions.
My problem comes in where I need to persist this shopping cart over several pages. Sure I could use cookies, but I would like to keep track of carts for statistical purposes (abandonment stats, items added but not bought, those kinds of stats) as well as ser-friendliness, like persisting their cart so that if they come back it is remembered. This is easy enough if a user is logged in, but I don't want to force a user to create an account if they don't want. Additionally, the way we were processing orders was a bit, ehh, slapped-together. All of the details (color selected, type selected, etc) are passed to paypal via their description string which for the most part is ok, but if a product has selections that are too long for the string (255 chars i believe), they are cut off and we have to call the customer to confirm what they bought. If I were to implement a more "solid" shopping cart, we wouldn't have to do that because all the customer's choices would be stored, in addition to the order automatically being entered into the order processing system (they're manually entered into an excel spreadsheet. i know, right).
I want to do this the right way, but I don't want to use any sort of overblown software that won't really work with our current business model. Do I use a cookie to "label" each visitor to match them with their cart (give them a cookie with a GUID) across pages, keep their whole cart client side, keep the cart server side and just pull it from the db on each page refresh?
View 2 Replies
Feb 3, 2011
I need to implement the following feature for a shopping cart using profile:
1. User opens the site from Computer A and selects items which are added to the shopping cart. Now suppose the User logs in the same items should be displayed in the shopping cart as before he logged in. Now say he adds some more items to the shopping cart and logs out, then the items he added newly should also be displayed in the shopping cart.
2. If the same User as in Step1 opens the site from Computer B and logs in there should be a different profile entry for him and he is not to be shown the items that were selected in the shopping cart in Step1.
I feel I need an implementation of the profile on per user+ computer basis for logged in Users. We have this kind of requirement for a B2B site where companies will have only one common login and it will be used by many Users to order items.
View 4 Replies
May 7, 2015
In my online shop, users can search products,each product have a link called add to shopping cart, users can add to the list many products like anonymous user, the question is.How can i do,for not to lose the product list, when user make Log in or create one account in my site
View 1 Replies
Nov 1, 2010
how can i cart items for shopping cart application ...i am really new to web development and i want to create a shopping cart and want to cart items in it. how should i cart items.
View 2 Replies
Jul 13, 2010
I am using a Session Arraylist to hold information about an online user. However, I am having troubel accessing the data. The error seems to be in the last bit because I can access one value of sample data just not print out a number of values. I have an class penalyPoint that has the following constructor:
public PenaltyPoint(string penaltyCode1, string penaltyDate1, string PenaltyPointsAwarded1, string penaltyBan1)
Then in a button response I have the following response which holds the data in a session arraylist variable as the user can enter a number of these objects. I will put a capacity limit on the arraylist later on.
//Assign the data in the form to a PenaltyPoint Object
PenaltyPoint penPoint = new PenaltyPoint(ddlPen1Code.SelectedValue, txtPenDate.Text, txtPen1Points.Text, txtPen1Ban.Text);
//The current driver number has to be set before this page is called
//Temp
int currentDriver = 0;
//int currentDriver = (int)(Session["currentDriverNum"]);
//create an arraylist to be used for transferring arraylist to session
ArrayList penPointsDrive0Array = new ArrayList();
if (currentDriver == 0)
{
//if the session is equal to null then nothing has to be returned from session
if (Session["penPointsArrayListDrive0"] == null)
{
penPointsDrive0Array.Add(penPoint);
Session["penPointsArrayListDrive0"] = penPointsDrive0Array;
Response.Redirect("PenaltyPoints.aspx");
}
else
{
penPointsDrive0Array = (ArrayList)Session["penPointsArrayListDrive0"];
penPointsDrive0Array.Add(penPoint);
Session["penPointsArrayListDrive0"] = penPointsDrive0Array;
Response.Redirect("PenaltyPoints.aspx");
}
}
Then I try to access the data in the arraylist but I getting nothing printing out. I am just trying to test the data at the minute. I am not that use to arraylist so this might be the problem.
public partial class TestPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ArrayList answer = new ArrayList();
ArrayList driver1 = (ArrayList)Session["penPointsArrayListDrive0"];
PenaltyPoint ps = new PenaltyPoint();
string output;
for (int i = 0; i < driver1.Count; i++)
{
ps = (PenaltyPoint)driver1[i];
string answertemp = ps.getPenaltyCode();
output = answertemp;
}
}
}
I can't get the final part to collect all the values into a string it keeps on coming up with errors.
View 2 Replies
Apr 23, 2010
I'm looking store an ArrayList into a session variable, but am having a few problems. Can you spot anything wrong?
public partial class _Default : System.Web.UI.Page { ArrayList score = new ArrayList(); protected void twist2(object sender, EventArgs e) { int a = 11; int c = RandomNumber(a); score.Add(c); score = (ArrayList)Session["scoreData"]; Result.Text = (c).ToString(); String Result_id = Result.Text; int total = 0; //Session["scoreData"] = score; for (int i = 0; i < score.Count; ++i) { total += (int)score[i]; } Sum.Text = (total).ToString(); String Sum_id = Sum.Text; }
View 3 Replies
Apr 24, 2010
I am using ASP.NET 2.0.
In my applicaion, I store some values in an ArrayList and store this Arraylist in a session variable. I want to know the size of this session variable in memory. Is there any method to do this.
View 6 Replies
May 11, 2010
can i get a good example.. in order to get started with shopping cart.. how long it's gonna take while implementing it..?
View 5 Replies
Feb 7, 2010
What is the easy way to create shopping cart?
View 8 Replies
Apr 25, 2010
offer a good shopping cart tutorial?This looked like just the thing: http://net.tutsplus.com/tutorials/other/build-a-shopping-cart-in-aspnet/There are postive and negative comments though.I'm a C# beginner so know how to put it mostly together, but I'm not experience enough to know anything about "singletons" and other performance issues that above code may have.
View 5 Replies
Jun 28, 2012
What is the most common or preferred control to build the shopping cart? By this, I mean the actual control that contains the product image, description, price & checkbox to select the item.
View 8 Replies
Feb 25, 2011
How to create a simple shopping cart in asp.net/c#
View 4 Replies
Dec 11, 2010
I am making progress on my shopping cart page. I want to show the contents of my shopping cart but I am puzzled on how to do this.
Here is the code :
Cart Class (Cart.cs)
[Code]....
Default.aspx ( I would like the cart to show up on a label on this page at the bottom)
[Code]....
[Code]....
View 3 Replies
Feb 28, 2011
I'm looking for a free shopping cart source code to start creating customized chart.MSC Musicstore sample code is too simple. NOPCommerce requires adding link into it in every page.Where so find such source code ?
View 4 Replies
Nov 21, 2010
Say i have a Laptop for 600.00. Say i change it to $650.00. How do shopping carts handle that? Like do they store the price in the cart or the item? How do they make sure they get the price they wanted but not bill the customer the new change without asking them? Or do most store them in both?
I was thinking maybe i could store it in both.So if the current price is over the cart price for a item, don't remove it/bill them from their cart. Then after, tell them what was billed/email a receipt for the items that didn't change that was billed(say they had more then one item) and remove it from the cart. For the items that did change, say something like "Items left in cart due to price change, check if you still want to buy the items at the new price." So leave the items that changed in the cart but update the price in the cart.
I don't think the language should matter. Guess this is more of a logical type question. Do most shopping carts do it this way or is there a better way?
View 3 Replies
Apr 2, 2011
I have a master page where in one ContentPlaceHolder I put my shopping cart:
<asp:ContentPlaceHolder ID="continutMeniuContulMeu" runat="server">
asp:UpdatePanel runat="server" ID="updatePanelCos" UpdateMode="Conditional">
<ContentTemplate>
<user:ShoppingCart ID="shoppingCartControl" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:ContentPlaceHolder>
View 1 Replies
Jul 9, 2010
I had done a shoppingcart in asp.net and i have to connect it to Authorize.net for payment process.
I dont know anything about this.
View 2 Replies
Mar 7, 2010
I am working on building a new shopping cart applicaiton. When i checked many shopping card applications, i found that the cateogry pages and product pages seems to be dynamically created. eg: http://shopping.sify.com/cadbury-bournville-almond/chocolates/CHOC24112009TTL14.htm
How this is being done? Is this page is created while adding product itself?
View 2 Replies
Mar 24, 2010
I am looking for a drag & drop shopping cart, which I can use with asp.net & can save the details in sql server 2005 database. I don't bother if it from ajax, javascript or jquery.Actually I have a grid, in which I am having picture, product name & price (say), so either I could be able to drag the row to the cart to add or increase the product quantity. or on click on the add to cart button, it will flow to the shopping cart.
View 10 Replies
Mar 28, 2011
How to implement shopping cart in asp.net. Provide with step by step procedures
View 3 Replies
Oct 20, 2010
I am working on a Railway Portal and would require maintaining a shopping cart of components user has selected, there could be multiple components of different type in the cart. I don't see a value in storing the cart in database, would like to store the final order in DB. Where can I store/hold (temporary) the cart data per user session in MVC? All MVC samples I saw online save the cart data in DB - not sure why.
MVC presentation layer will be communicating with external web services for pricing and availability of these components, so I can't store only the product IDs to do a lookup for actual product descriptions/prices during the shopping process... I have to store everything in the cart (Product IDs, Descriptions, Prices etc) some place in memory. My application will be running in WEB FARM environment and cannot use in-process session storage.
Options come to my mind are:
SESSION STATE in SQL SERVER Using some kind of Distributed Caching Mechanism to store Session data such as "Windows Server AppFabric"
View 4 Replies
Mar 3, 2011
How to create search box for shopping cart: textbox with search button. Clicking in search button or pressing enter should call search method in controller.
Where to find sample style and code for this for MVC application ?
View 3 Replies