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

  • Home
  • SEARCH
  • 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 9109393
In Process

The Archive Base Latest Questions

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

I have a ASP.NET MVC4 wizard. To pass one big viewmodel from step to

  • 0

I have a ASP.NET MVC4 wizard. To pass one big viewmodel from step to step I use the futures assembly. I serialize my model with

@Html.Serialize("model", Model, SerializationMode.Signed); 

and deserialize it in the controllers

protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
    var serialized = Request.Form["model"];
    if (serialized != null)
    {
        model = (BausparViewModel)new MvcSerializer().Deserialize(serialized, SerializationMode.Signed);
        TryUpdateModel(model);
    }

...
}

I set the TempData in the

protected override void OnResultExecuted(ResultExecutedContext filterContext)
{
    if (filterContext.Result is RedirectToRouteResult)
        TempData["model"] = model;
}

Every wizard step has it’s own view and I manage previous/next actions in the controller with RedirectToAction(“ActionName”)

Everything works fine, as long as the browser gets no refresh by using F5 or the menu. On this point the controller gets called again. The controller already has a model,although the TempData doesn’t get saved again.

But there are two enum properties missing. They are used in previous steps. They got bound to the view via RadiobuttonFor.

So why is there a model which is incomplete?

Thanks in advance
csteinmueller

  • 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-17T03:02:16+00:00Added an answer on June 17, 2026 at 3:02 am

    For anything that should live longer than 1 request, you should not use TempData. Use Session or some other longer term storage mechanism.

    TempData is designed to delete a value after it is read out of the dictionary. That’s why TempDataDictionary has methods like Peek and Keep. Those methods let you tell the dictionary explicitly “hey, don’t delete this value after I read it”, because by default, it does delete the value after you read it.

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

Sidebar

Related Questions

I use ASP.NET MVC4 in my solution. I have the ViewModel below where I
Using ASP.NET MVC4 I have created a DelegatingHandler in a WebAPI project. I use
I have a ASP.Net MVC4 website that uses twitter bootstrap along with Knockoutjs. One
I have a long-running asynchronous task that is kicked off from an ASP.NET MVC4
I have an ASP.NET MVC4 Application. I use ninject for DI and WebActivator to
I have an ASP.NET MVC4 website implementing a REST API, which I'm consuming from
I have changed from vs 2010 to 2012 with asp.net MVC4.I have connected my
I have an ASP.NET MVC4 site with mobile content. When I deploy this on
I have an ASP.NET MVC4 app which uses DotNetOpenAuth 4.0.1 to authenticate users with
I have a simple asp.net MVC4 / EF 4.1 project created with VS 2011,

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.