4
Staff I have a controller where Seto two session keys and that capture those key anywhere in the application. (other controller, or a view).
The controller is like this:
[HttpGet]
public ActionResult TimetableSelect(int currentTimetableId, string currentTimetableName)
{
Session["TTBId"] = currentTimetableId;
Session["TTBName"] = currentTimetableName;
return RedirectToAction("Dashboard");
}
But in the view I consult equal is below, and is always returning null.
@if (Session["TTBId"] != null && Session["TTBName"] != null)
{
....
}
Can someone tell me what I’m doing wrong?
Possible duplicate of Persist information using Viewbag?
– Maniero
I believe it is not duplicate, perhaps because of the way the information persists for a Session yes, but its initial problem is not the same as that of the link. His problem is information traffic through the system, causing errors in code verification. Bigger problem is the question user’s lack of interaction
– user46523