Pradeep Yadav
How to maintain session in Asp.net MVC?
By Pradeep Yadav in ASP.NET on Jul 02 2017
  • Rajani Pandey
    Jan, 2018 7

    We dont have session in mvc but we can store data with the help of tempdata, viewdata , viewbag

    • 3
  • Rajeev Kumar
    Mar, 2023 31

    To pass a Seesion We use- System.Web.HttpContext.Current.Session[“UserArticleId”] = articleId;

    To hold the value of a session we use-
    var articleId = System.Web.HttpContext.Current.Session[“UserArticleId”];
    For clear a session - System.Web.HttpContext.Current.Session.Clear();

    • 0
  • Kishu Sharma
    Feb, 2019 15

    Viewbag,tempdata,viewdata

    • 0
  • Lalit Raghav
    Aug, 2018 30

    HttpContext.Current.Session

    • 0
  • Pradeep Yadav
    Jul, 2017 2

    You can use tempdata, viewdata and viewbag.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS