Reputation: 2024
I want to access a session variable from my layout master page, but you cant have a model in a layout page, so how do I access this variable?
Upvotes: 1
Views: 7247
Reputation: 888303
You should move that logic to a child action and call the child action from the master page using @Html.Action(...)
.
To answer the question, use the Session
property.
Upvotes: 1