Question

Is there a cap or best practice with regards to how much data should be placed in the TempData dictionary?

Was it helpful?

Solution

Check this post that describes best practices when using TempData:

When to use ViewBag, ViewData, or TempData in ASP.NET MVC 3 applications

This one goes even further:

ASP.NET MVC: Do You Know Where Your TempData Is?

Bottom line is: By default, TempData is stored in the Session object. So the limit is the limit of your Session object. See this post for some insight.

Things to consider:

  • Generally, Session is stored in workerprocess memory eg.: in RAM....
  • To increase the amount of available memory, check the memory limit of your Application Pool in IIS.

For a more in-depth view of the Session object, check this doc at MSDN:

ASP.NET Session State Overview

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top