Having problem with my shopping mvc?http://forums.asp.net/t/1794416.aspx/1?Having+problem+with+my+shopping+mvc+Thu, 19 Apr 2012 14:00:40 -040017944164939722http://forums.asp.net/p/1794416/4939722.aspx/1?Having+problem+with+my+shopping+mvc+Having problem with my shopping mvc? <p>I started using the shopping code form music mvc everything was going good then I notice two things.</p> <p>one is: When I purchase an item show listed in cart. I logout as user close browser open browser login as a different user item cart is still present.</p> <p>using IIS 7.5.</p> <p>Second is: When using VS2010 I can delete items using the music cart but when using IIS will not delete.</p> 2012-04-18T21:43:50-04:004939750http://forums.asp.net/p/1794416/4939750.aspx/1?Re+Having+problem+with+my+shopping+mvc+Re: Having problem with my shopping mvc? <p>The shopping card in mvcmusicstore uses the session variable. That should be unique for each user.</p> <p>The delete link is most likely caused by a path reference problem. I'm guessing you're deploying to a virtual directory (sub folder) in IIS. That often causes problems with hardcoded paths. MVC music store uses a jquery ajax post to delete the user. You need to make sure you user @Url.Action instead of hardcoding in a path to the delete action method. In the shopping card index view. Make the following change:</p> <pre class="prettyprint">//Change this line $.post(&quot;/ShoppingCart/RemoveFromCart&quot;, { &quot;id&quot;: recordToDelete }, //To this $.post(&quot;@Url.Action(&quot;RemoveFromCart&quot;,&quot;ShoppingCart&quot;)&quot;, { &quot;id&quot;: recordToDelete },</pre> <p>Basically instead of hardcoding in the url, we are letting the mvc framework resolve the url. If the application is local or an the site root, the framework will generate a url of /ShoppingCard/RemoveFromCart. But if the mvc applicationg is deployed a virtual directory, it will now appear in the correct path.</p> 2012-04-18T22:15:43-04:004939757http://forums.asp.net/p/1794416/4939757.aspx/1?Re+Having+problem+with+my+shopping+mvc+Re: Having problem with my shopping mvc? <p>Thanks, &nbsp;I should have read the documentation.</p> <p></p> 2012-04-18T22:26:39-04:004941231http://forums.asp.net/p/1794416/4941231.aspx/1?Re+Having+problem+with+my+shopping+mvc+Re: Having problem with my shopping mvc? <p>Thanks I use the code did not work. But looking up what you gave allowed me look at the complete ajax post and the problem was the&nbsp;</p> <p>&lt;script src=&quot;~/Scripts/jquery-1.5.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>I had to change it to this&nbsp;&lt;script src=&quot;@Url.Content(&quot;~/Scripts/jquery-1.5.1.min.js&quot;)&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>Not it is firing thanks.</p> 2012-04-19T14:00:40-04:00