title: How to pass HttpContext.Current to function?
body: <p>In my action of controller i want to use function for to set cookies if they are not installed, and to add in cache some data.</p>
  
  <p>Controller</p>
  
  <pre><code>    [HttpGet]
      [ActionName("Search")]
      public ActionResult SearchGet(SellsLiveSearch Per, int page)
      { if (HttpContext.Request.Cookies["G"] != null)
           {...}
         else
           {SearchFunc(Per);}
      }
  
      public static List&lt;SellsLive&gt; SearchFunc(SellsLiveSearch Per)
      {...
       System.Web.HttpContext.Current.Response.SetCookie(cookie);
       HttpContext.Cache.Add
             (
               Key,
               Data,
               null,
               DateTime.Now.AddMinutes(30),
               TimeSpan.Zero,
               System.Web.Caching.CacheItemPriority.Normal,
               null
             );
      }
  </code></pre>
  
  <p>But i can't do this, because VS gives error:</p>
  
  <p>HttpContextBase Controller.HttpContext</p>
  
  <p>Error:</p>
  
  <p>For the nonstatic field, method or property "System.Web.Mvc.Controller.HttpContext.get" requires an object reference.</p>
  
  <p>What am i doing wrong and what i need to do?</p>