Advertisement
Guest User

napernik

a guest
Feb 1st, 2011
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.  public class BasketController : Controller
  2.     {
  3.         public ActionResult Index()
  4.         {
  5.             var cache = System.Web.HttpContext.Current.Response.Cache;
  6.             cache.SetCacheability(HttpCacheability.NoCache);
  7.             cache.SetNoServerCaching();
  8.             cache.SetNoStore();
  9.  
  10.  
  11.             var newItems = data.Get<Product>().OrderByDescending(f => f.Status);
  12.             if (HttpContext.Session["Basket"] == null)
  13.             {
  14.                 HttpContext.Session["Basket"] = 0;
  15.  
  16.             }
  17.             int count = (int)(HttpContext.Session["Basket"]);
  18.  
  19.             count++;
  20.  
  21.             HttpContext.Session["Basket"] = count;
  22.             ViewBag.Count = count;
  23.             return View(newItems);
  24.         }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement