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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T08:59:09+00:00 2026-05-19T08:59:09+00:00

guys. I have an ASP.NET MVC page where the model is being edited. On

  • 0

guys.
I have an ASP.NET MVC page where the model is being edited.
On each action executing I have a new controller, so I don’t get an updated model.
I’m saving a model instance into Session[“MyModelKey”]. But every time an action is executed, I have unmodified instance there even if I have changed values in textboxes which were created like this:

@Html.LabelFor(model => model.EMail)
@Html.TextBoxFor(model => model.EMail)
@Html.LabelFor(model => model.Country)
@Html.TextBoxFor(model => model.Country)
@Html.ActionLink(“MyAction”, “MyController”)

Controller:

public class MyController : Controller
{
    public ActionResult MyAction()
    {
       //Every time this action is executed - I have a new controller instance
       //So I have null in View.Model
       //I get Session["MyModelKey"] here, 
       //But the model instance properties are not updated 
       //even though I have updated E-mail and Country properties of the model in the UI
    }
}

So, how can I get an updated model?

Thanks in advance.

  • 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-05-19T08:59:09+00:00Added an answer on May 19, 2026 at 8:59 am

    No need to save to session the model binder will work behind the scenes to match the posted form values to your model properties.

    Make sure you use a submit button though, and wrap the UI elements with a form so the page will post. Your action link will not have the same outcome.

    public class SomeFormModel
    {
        public string Email { get; set; }
        public string Country { get; set; }
    }
    
    public class MyController : Controller
    {
        public ActionResult MyAction()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult MyAction(SomeFormModel model)
        {
            return View(model);
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
Guys I am a new bee to asp .net mvc 3. In the MS
I am fairly new at using the ASP.NET MVC framework and was hoping that
I'm begginer in asp.net mvc and i have some doubts. P.S: I'm using DDD
I'm developing an application using asp.net mvc, NHibernate and DDD. I have a service
This question is being based off of a similar question titled, ASP.NET MVC Relative
I have been using telerik extensions for an asp.net mvc project, more specifically the
We have an ASP.NET MVC app that sits on top of a Drupal database
I have a bizarre routing issue with my ASP.NET MVC project that I hope
I'm creating a website with asp.net, mvc 4 and c# and currently have a

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.