Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BasketController : Controller
- {
- public ActionResult Index()
- {
- var cache = System.Web.HttpContext.Current.Response.Cache;
- cache.SetCacheability(HttpCacheability.NoCache);
- cache.SetNoServerCaching();
- cache.SetNoStore();
- var newItems = data.Get<Product>().OrderByDescending(f => f.Status);
- if (HttpContext.Session["Basket"] == null)
- {
- HttpContext.Session["Basket"] = 0;
- }
- int count = (int)(HttpContext.Session["Basket"]);
- count++;
- HttpContext.Session["Basket"] = count;
- ViewBag.Count = count;
- return View(newItems);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement