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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:42:38+00:00 2026-06-05T09:42:38+00:00

I wanna do something like this: [HttpPost] public ActionResult Index(Foo foo) { foo.Name =

  • 0

I wanna do something like this:

[HttpPost]
public ActionResult Index(Foo foo)
{
    foo.Name = "modified";

    return View(foo);
}

but when my view is rendered, it always has the old values! How can I modify and return? Must I clear the ModelState everytime?


My view:

@model MvcApplication1.Models.Foo


@using (Html.BeginForm())
{
    @Html.TextBoxFor(m => m.Name)
    @Html.TextBoxFor(m => m.Description)

    <input type="submit" value="Send" />
}
  • 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-05T09:42:40+00:00Added an answer on June 5, 2026 at 9:42 am

    I think this might be expected behavior because the “normal” scenario where you send back the same model to the view is when the model has errors.

    See: http://blogs.msdn.com/b/simonince/archive/2010/05/05/asp-net-mvc-s-html-helpers-render-the-wrong-value.aspx

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

Sidebar

Related Questions

I wanna do something like this, but this one looks like happing for infinite
I need something like this , but with date picker. I don't wanna include
Hey i wanna do something like this: i=2; _root.(process + i)._x = var_Process_Pos_x; how
I wanna do something like this: int main() { try { runApp(); } catch(std::exception
I wanna do something like this: List<string> list = new List<string>(); ... put some
So i wanna do something like this in php. If i have a year
I'm doing a page with jsf 2.0 and i wanna do something like this:
Basically all i wanna do is something like this. var myVar = $.load(phpscript.php,var=one); phpscript.php
I wanna do something like this: <?php $editor = new editor('reply.php?topic=100', 'simple'); echo $editor;
I wanna do something like this. I know it’s wrong: var a = from

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.