Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax.BeginForm response contains previous values even if I pass another model
    primarykey
    data
    text
    <p>I'm having a simple action:</p> <pre><code> [HttpPost] public virtual ActionResult New(Feedback feedback) { feedback.CreatedDate = DateTime.UtcNow; if (TryValidateModel(feedback)) { FeedbackRepository.Add(feedback); var model = new Feedback { SuccessfullyPosted = true }; return PartialView(MVC.Shared.Views._FeedBackForm, model); } return PartialView(MVC.Shared.Views._FeedBackForm, feedback); } </code></pre> <p>So, idea is if received data is validating fine, return partial view with empty feedback entity. Thing is, that if i look at firebug response, I see old values coming back, how weird is this?</p> <p>Form looks like this:</p> <pre> @using (Ajax.BeginForm(MVC.Feedback.New(), new AjaxOptions { UpdateTargetId = "contactsForm", HttpMethod = "post" })) { <br /> <p> @Html.LabelFor(x => x.FirstName) @Html.EditorFor(x => x.FirstName) @Html.ValidationMessageFor(x => x.FirstName)</p> <p> @Html.LabelFor(x => x.LastName) @Html.EditorFor(x => x.LastName) @Html.ValidationMessageFor(x => x.LastName)</p> <p> @Html.LabelFor(x => x.Email) @Html.EditorFor(x => x.Email) @Html.ValidationMessageFor(x => x.Email)</p> <p> @Html.LabelFor(x => x.Phone) @Html.EditorFor(x => x.Phone) @Html.ValidationMessageFor(x => x.Phone)</p> <p> @Html.LabelFor(x => x.Comments)<br /> @Html.TextAreaFor(x => x.Comments, new { cols = 60, rows = 10 }) @Html.ValidationMessageFor(x => x.Comments) </p> if (Model.SuccessfullyPosted) { Feedback sent successfully.</p> } <p> </p> } </pre> <p>Is it possible somehow to disable this behavior and how <code>PartialView(MVC.Shared.Views._FeedBackForm, model)</code> manages to get different model?</p> <p>update: I see stackoverflow ate all html from by view and can't find how to fix that.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload