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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:54:49+00:00 2026-05-30T22:54:49+00:00

I have a properly working ajax form in my MVC3 application except for one

  • 0

I have a properly working ajax form in my MVC3 application except for one caveat. After I submit the form and get the result, even though the passed in model has a different value for the input (Amount in the example below) the old value still shows up on the screen. I attribute this to the value being saved in the DOM and overriding/preventing the new value from the model. There are various ways to fix this by running a javascript function on one of the form events.

I would like to get feedback on what is the best way to handle this situation, preferably native to MVC and without javascript. Here are the code snippets:

Parent View:

<div id="MyContainder">
    @Html.Partial("MyPartialView", ClassContainingAmountProperty)
</div>

Partial View:

@using (Ajax.BeginForm(actionName: "myaction",
              ajaxOptions: new AjaxOptions() UpdateTargetId = "MyContainder"})
      @Html.EditorFor(x => x.Amount)
      <input type="submit" value="Save" />
)

Controller

myModel.Amount = SomeNewNumber;
return PartialView(myModel); //same partial view returned but with new amount
  • 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-30T22:54:51+00:00Added an answer on May 30, 2026 at 10:54 pm

    As soon as I ask the question I found the answer!
    ASP.NET MVC 3 Ajax.BeginForm and Html.TextBoxFor does not reflect changes done on the server

    You must call

    ModelState.Clear();
    

    inside the action before returning the partial view

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

Sidebar

Related Questions

Have posting working wonderfully, and reading the response happily EXCEPT when one of the
I have an AJAX web part which is working properly in my local windows
I have some issues with a PHP file that is not working properly. The
I have configured the wildcard DNS of *.mydomain.com and it's all working properly. My
How can I tell if my call to SendInput is working properly? I have
In my project, I have so many .png images. They are working properly in
I am working on an MVC3 application. My client side ViewModel contains a SQL
I have a form with two buttons, a submit button and a cancel/close button.
I wrote the Ajax function like below. It is not working properly. If I
Built a simple JQuery/Ajax newsletter signup form, then went back after the fact to

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.