Skip to content

Create cookies in MVC4 rasor c#

fadoua jaouhar

fadoua jaouhar

Asked Feb 3, 2015, 8:51 AM EST2 answers
Share
LinkedInX
Hi please how we can create cookies in MVC4 rasor, thank you so much 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Burak Seyhan
    +1
    public ActionResult Index() { HttpCookie hc = new HttpCookie("damydata","12345"); Request.Cookies.Add(hc); return View(); } then go view ( like aspx) <%=Request.Cookies["damydata"].Value%> use this I think this can work
    +1
  • fadoua jaouhar
    0
    Hi burak seyhan Thank you :) .
    0