State Management :: Removing Profile Items From Cart?
Mar 12, 2011
i've a songs website, where i'm adding items to cart for users who are logged in, but when a song is deleted from the website the users still have the cart info still intact, i'd like the songs in the cart also too be deleted when the song from the website is gone, how may i accomplish this ?
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.
the purpose of using Profile in asp.net. I would like to know the usage of profile in shopping cart based sites.I could see from some of the cart websites that profile plays a major role for online shopping projects.It is better to know how this profile to create opnline website and which websites or example to reach the technologies as well.
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.
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?
I am looking for an elegant (i guess as elegant as it can be) solution to caching a users profile on login (whether it is session, cache, cookie, etc) and keeping it in sync when a users profile is changed. How do you guys handle this? Just simply call a Flush() method in your Save() method that invalidates the cache?
I am learning how to use profiles. My profile properties are defined in web.config and wish to add selected checkboxlist values to user profiles.TextBoxes and RadioButtonLists all seem to work fine, but not my CheckBoxList values.How do I go about making this work?
I am working on a site in which some pages are to be run on secured server(ie https) & some on non-secured(ie http) eg Login, User Information, etc. will be run under https & View cart, etc. are to be run on http. Now, when user chooses some products in his cart, he is prompted to enter login details. After he fills in his login detail(ie in https), he is redirected to Checkout. But here the Session doesn't picks the value and it shows Session[UserID] value null. So, rather then redirecting to Checkout it shows MyAccount page. Does anyone know how to pass Session Value from https to http.
I have a listview control, in it each item will have a checklist eg - Pass / Fail which will then have a label displaying the selected value. I also have datapager wired up to the listview.
When i toggle between the datapages and toggle back, any result previously submitted will be wiped.
I am thinking i should be using session state to temporarily store then info, and then once the session is finished use a submit button to send all values and ids into an xml.
1. Is this the right way of approaching the situation?
2. How would i specify session state for listview items, eg would i angle it through a itemdatabound event or the application itself?
i have defined profile properties in my web config file but unable to access them in code behind. even profile object is not available. i have to writer fully qualified name like System.Web.Profile. below is my web config
I've done a bit of searching on this subject and haven't found anything so far. I am successfully using the Profile object and am saving Profile records away into my SQL Server Database. I have checked using the stored procedures and viewed the individual records to know they are there. However, I want to create a WebForm that can enumerate through all of the users in my Membership DB (Same DB as the Profile DB) and list each user in a grid showing what values each user has within their profile. For example:
Username Profile Element 1 Profile Element 2 Profile Element 3 bob true false true fred true false true
I want however to replace the 'Profile Element 1' etc etc to display the actual name of the Profile. I would like to do this programmatically so I don't have to recompile the website everytime I add a new Profile element.
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.
I have an asp.net application consisting of two web pages and a web service. All components are part of the same project, i.e. I have a solution with only one project. The web service queries a server and fills the information it retrieves into container objects which are stored in the cache of the application. This done using the Cache.Insert method:
OnRemove is my handler that writes the reason into the log file in case the item is removed from the cache. Now from what I understand this example item should never be automatically removed from the cache. Basically this is what I want: It shall stay in the cache until I explicitely remove it. Once the cache is populated by the web service one of the web pages visualizes the cache content using html. The other web site contains a button to manually kick on the web service and one button to clear the cache content, i.e. remove everything in the cache. Unfortunately somehow the cache seems to get cleaned up once in a while. In irregular intervals all containers that are created by the web service and are stored in the cache are removed from the cache. I don't understand the reason for this. The only place in the code I remove something from the cache is when I manually press the clean cache button on one of the web pages.
What is strange is that all container objects in the cache are removed, not just a few. But this is not because the button that cleans the cache is pressed. I know this because a log entry is created whenever that button is pressed. To find out what is going on I attached the OnRemove handler which just logs the reason why a cache item is removed. In my case the reason is "Removed". I simply don't get it. How can I ensure that the cache just stays as it is? Items placed in there shall just stay there. Nothing shall be cleaned up automatically.
An instance of the shopping cart is created like this:
If HttpContext.Current.Session("ASPNETShoppingCart") Is Nothing Then Instance = New ShoppingCart() Instance.Items = New List(Of CartItem) HttpContext.Current.Session("ASPNETShoppingCart") = Instance Else Instance = CType(HttpContext.Current.Session("ASPNETShoppingCart"), ShoppingCart) End If
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try loginRep = BusinessLogic.SR.GetUserName("99999") System.Web.HttpContext.Current.Items.Clear() System.Web.HttpContext.Current.Items.Add("RepId",loginRep)
I don't any errors and when in the run in the immediate window:
? System.Web.HttpContext.Current.items("RepId") in the immediate window on THAT page I get the OBJECT.
Then I have a hyperlink with navigateurl to the next page "~/ActCnt.aspx"
On that page, ActCnt.aspx, when in the code I have:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadIf Not Page.IsPostBack Then Dim loginRep As BusinessLogic.SalesRep = System.Web.HttpContext.Current.Items("RepId")
In the immediate window ? System.Web.HttpContext.Current.Items("RepId") returns a String that is equal to "RepId".
Even if I change it to not be an object, but a string I only get the Name "RepId" of the keypair. I have NEVER gotten the actual value.
I have a multiview inside an updatepanel. in one of the views, I save a value in a session object like this:
Session["xyz"] = "some string value";
Then I switch to another view and try to pick it up the value in a button's OnClick event:
string x = Session["xyz"].ToString();
But I get a null reference error. Debugging it shows that Session["xyz"] is indeed null, yet other Session variables are still there. Is there something special about Session and AJAX?
We have a section of our site that allows you to add items to a cart, nothing to sell.. just keep while you are on the site and can go back to..
On the page that you have that ability to add items, i also have a label that displays the number of items.. Now that we are going to go live with this, thay have moved the count to the menu, but the menu is within the Site.Master file, so its not being populated. But it works fine on the page where you can add items..
So what can i do to accomplish the task of displaying the total number from my master file, right now you can only see the accurate number on the page you add to cart.. once you select another page, you dont have it anymore..
This is within my event for the "Add to Cart" button, this works, because the label is on this page. But now the label is within the master file and even though the below works, the number doesnt update on the menu .
I am trying to get a simple multi-page program to run correctly. I have everything set up, except for the "remove" function. When I try to remove an item from the list box nothing happens. Insted of trying to explain it I will show you the code...
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