Last post Aug 11, 2020 02:46 PM by Baze72
Aug 11, 2020 02:23 PM|Baze72|LINK
How can I use a session variable in a controller to pass as a parameter for a stored procedure? I have a Public Action result where this works fine, but I can not get it to work on a private static. Do I have any options to get this to work? I am setting
the Branch session in the controller. Below is the code how I am setting the parameter for the Public Action result.
private static List<Birthdays> GetBirthdays()
var branch = @Session["Branch"];
Aug 11, 2020 02:36 PM|bruce (sqlwork.com)|LINK
Unless you have only one user, this won’t work. Static are shared across all requests, so if you have two requests at the same time, it can only have one value.
Aug 11, 2020 02:46 PM|Baze72|LINK
I figured it out. Thanks!!