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 9185533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:18:02+00:00 2026-06-17T19:18:02+00:00

besides TempData, which I believe isn’t the best thing to use nowdays, what are

  • 0

besides TempData, which I believe isn’t the best thing to use nowdays, what are some best practices in how you can persist user data from page to page?

Do you usually just go back to the DB every time…ajax or not…do you make a request every time or do you store it in lets say the Request object or some other in process object instance?

I’m just looking for a broad range of ideas as I am overwhelmed with looking this up on the net…there’s a LOT out there and it would be easier for me to get some insight via stack as well.

  • 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-17T19:18:03+00:00Added an answer on June 17, 2026 at 7:18 pm

    There are several options. If we’re talking about intrarequest, then of course ViewBag is the best choice. Intrapage (across requests) then the best choice is probably hidden fields, unless it’s sensitive data.

    Between pages, then there are several options. You can of course pass data as query string parameters. Session also makes a convenient option, so long as the data size is small, and it’s ok if the session gets lost (ie, you can get it again or regenerate it). In certain other situations, you can post data to another page using hidden fields, but this should largely be discouraged since you should prefer to use PRG (Post/Redirect/Get) pattern.

    Some other options are using the context cache HttpContext.Cache (Which i feel is misnamed, but oh well) or saving it in temporary tables in the database. Any “in-memory” option will have scalability issues if you decide to move to a web farm (Session can be made to be backed by database, but it slows things down).

    It also depends on what data you’re talking about. If it’s user data, then another option is to store it in a cookie, or to use the user data portion of the Forms Authentication cookie, and create a custom IIdentity object.

    Finally, there’s just rebuilding the data from its source on every request.

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

Sidebar

Related Questions

Besides GIS applications, which other applications or libraries use R-trees and its variants?
Besides while loop and Cursors How can I use CTE table to do n
I have a method which besides some other actions also modify one of the
Besides the existence of Smarty.class.php (which is also arguable), how do we know that
Besides polling , how can I tell when a long-running Amazon EC2 operation is
Which other languages besides English does Levenshtein distance support its implementation? I know that
Besides printing stuffs for the console what other use have you found for toString()
Besides just using yield for iterators in Ruby, I also use it to pass
Besides 'new', 'delete', '<<' & '>>' operators, what other operators can be overloaded in
Besides stackoverflow, what are the best sites to showcase my development skills? For those

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.