In this article I will explain with an example, how to display Session value inside View in ASP.Net MVC.
The Session value will be displayed using Razor Syntax in ASP.Net MVC.
Displaying Session value inside View in ASP.Net MVC
In the below example, a string value is set in the Session object in Controller and it is then displayed in View using Razor Syntax.
public class FirstController : Controller
    // GET: First
    public ActionResult Index()
        Session["Message"] = "Hello MVC!";
        return View();
    <meta name="viewport" content="width=device-width"/>
ASP.Net MVC: Display Session value in View