I am trying to return a view that excludes rows to which the user had clicked to hide and a cookie is generated storing information of which rows the user wishes to hide.
My issue is that the cookie only contains one value, and so my select statement only excludes one row at a time. Here's what I have:
public ActionResult Hide(int id)
{
HttpCookie cookie = new HttpCookie("HideCookie");
cookie.Value = id.ToString();
cookie.Expires = DateTime.Now.AddYears(1);
System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
int i = Convert.ToInt32(Request.Cookies.Get("HideCookie").Value);
var quotes = from q in db.View1 where !q.Quote_ID.Equals(i) select q;
return View(quotes.ToList());
}
I've tried creating a string and keep appending new values to the string but it still only takes the last value clicked.