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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:30:55+00:00 2026-05-16T14:30:55+00:00

I have a blogpost edit page where you can either save your edits or

  • 0

I have a blogpost edit page where you can either save your edits or upload an image (multiple submits in a single form). When you upload an image, the image link gets appended to a TinyMCE content area.

The fields for the form are in a viewusercontrol(shared with create page). Both the viewpage and usercontrol inherit from BlogPost so the model’s being passed directly using <% Html.RenderPartial("Fields", Model); %>

So here’s the weird thing; in my controller, when I append the image link to the textarea, nothing happens to the textarea in the view

On my viewpage I have a label for Model.Title and within the usercontrol I have the textbox for editing Model.Title.

If I update the label in the controller – model.Title = "New Title" – the updated model data changes for the label in the viewpage but not the textbox in the usercontrol.

My Controller is like this:

// /edit/{id}
public ViewResult Edit(int id, BlogPost model, string submit)
    {
        if (ModelState.IsValid)
        {
            switch (submit)
            {
                case "Upload":
                    var files = UploadFiles(Request.Files); // uploading works

                    model.Content += files[0].Link; // model is updated but not cascaded at runtime
                    model.Title = "Test"; // Force a title change to reproduce the issue
                    return View(model);

                default:
                    repository.Update(model);
                    break;
            }
        }

        return View(model);
    }

Any ideas as to what’s causing this and how to fix it? Thanks.

  • I am using 4.0 and MVC 2
  • 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-16T14:30:55+00:00Added an answer on May 16, 2026 at 2:30 pm

    Turns out that this behaviour is by design and has been answered by Phil Haack here:

    Possible bug in ASP.NET MVC with form values being replaced.

    There’s also a blog post about this here:

    ASP.NET MVC’s Html Helpers Render the Wrong Value!

    For my scenario (appending an image to tinymce), I think it’s safe to clear the ModelState because we’re explicitly appending to a textarea and not doing any validation yet.

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

Sidebar

Related Questions

assume that i have a BlogPost model with zero-to-many embedded Comment documents. can i
Hi I have a 2 tables BlogPost and BlogComments I want to get all
I have a few models: 'Article, Video, BlogPost, News, Commodity'. Each are in their
I have a blog post page with comments. Any user (logged in or not)
I need to do some model-level validation in an MVC 3 edit page. (To
my question is the following How can I display a standard rss page after
Say I have the following models: class Image(models.Model): image = models.ImageField(max_length=200, upload_to=file_home) content_type =
I have a register form created by mvc3 scaffolding. e.g. <div class=editor-label> @Html.LabelFor(model =>
I have looked at other posts and can't see what I'm doing wrong. I'm
I have a page tab app. When the user clicks on the Go 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.