Right at the beginning, the procedure checks for cart.Count == 0. If the cart is empty, it return the model to the page so that it can displays an empty page stating "Your Shopping Cart is empty!"
I would like to know what is the best way to redirect to another page, in case of the cart.Count == 0. Any ideas will be very welcome !!
The only way of doing it is check whether a cart doesn't have any items in your action method ('Cart' method in your case) and return a RedirectToAction if required
By Action Method, are u referring to the [NonAction] procedure I stated above? Cause if that the one, because of the return type, we cannot return a RedirectToAction.
Compiler will tell us NOPE. What I did, so far, is this:
By action method I meant 'Cart' method of 'ShoppingCartController' P.S. Do not use "Response.Redirect" in your controllers, use 'RedirectToAction' or 'RedirectToRoute' like it's done other mnethods