The WebFarm we are using doesn’t supports Session. We are in a requirement to pass Data during redirects. How to do this without TempData dictionary since TempData uses Session inside.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can write your own TempData provider and store it in cookies. See ASP.NET MVC Store TempData in Cookie Or you could have a base-class Controller that looks for a hidden input and hydrates objects / state and persists it to / from it each http request.
Note that TempData only persists between two controller actions.
Edit:
You could use the same example and write a provider that serializes to a DB … or … even to disk. Shoot, for that matter, you could even roll an entire custom replacement for Session. You’d create a session factory class and store your custom session objects via a key in some static collection. Then you’d track that session key either through cookies or via hidden input as stated above.