Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:18:34+00:00 2026-06-01T09:18:34+00:00

I have read that TempData is backed by session in Asp.Net MVC, but only

  • 0

I have read that TempData is backed by session in Asp.Net MVC, but only valid for the duration of the current request. This makes it appropriate for Redirect2Action etc.
Given that it’s only valid for the current request, does that mean that you won’t get into issues with load balancers and session on WebFarms. Basically because you’re only on one webserver per request.

Would it be an option to back it by the Request.Items collection instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:18:36+00:00Added an answer on June 1, 2026 at 9:18 am

    TempData is only valid for the current and next request which is why it is stored in the session state. Storing it with the request would not work.

    So any limitations that would break saving items in session state (e.g. load balances) will break TempData as well.

    See the documentation for TempDataDictionary

    You can use a TempDataDictionary object to pass data in the same way
    that you use a ViewDataDictionary object. However, the data in a
    TempDataDictionary object persists only from one request to the next,
    unless you mark one or more keys for retention by using the Keep
    method. If a key is marked for retention, the key is retained for the
    next request.

    A typical use for a TempDataDictionary object is to pass data from an
    action method when it redirects to another action method. For example,
    an action method might store information about an error in the
    controller’s TempData property (which returns a TempDataDictionary
    object) before it calls the RedirectToAction method. The next action
    method can then handle the error and render a view that displays an
    error message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that viewstate is not there in asp.net MVC application. I am
I have read that ASP.NET uses connection pooling to manage database connections so it
In ASP.NET MVC 2, TempData values persist until the session ends or until they
I have read that you can do it, but would this really improve performance
I have read that dealloc for an object will be called, only if retain
I have read that after select we use column-names but I have found a
I have read that copying the data directory will work. But, that is a
I have read that CTE are better than cursor. But I am unable to
I have read that in a case where a table has many columns, but
I am writing a learning project in ASP.NET MVC. I have a page Books

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.