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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:20:19+00:00 2026-05-13T17:20:19+00:00

I have a View in MVC 2 where I edit a Page. A Page

  • 0

I have a View in MVC 2 where I edit a “Page”. A Page has a Name, Title and Content. Content is of type EditableContent, which has Width, CssClass and Columns. Columns is a List.

When I do this in the view:

<%= Html.TextBoxFor(m => m.Name) %>

It outputs the following HTML:

<input type="text" value="About Page" name="Name" id="Name">

And when I post to the Edit action in ContentController:

/// <summary>
/// Edits the specified form.
/// </summary>
/// <param name="item">The content page.</param>
/// <returns>ActionResult for edit</returns>
[HttpPost]
public ActionResult Edit(Page item)
{
    if (ModelState.IsValid)
    {
    }

    return View(item);
}

It cannot bind the Name property to item.Name. Looking up the values in Request.Form, I see the Name parameter.

If I render the textbox manually, using this:

<%= Html.TextBox("item.Name", Model.Name)%>

The value is binded perfectly to the Page instance in the controller action.

Am I doing something fundamentally wrong here?

  • 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-13T17:20:20+00:00Added an answer on May 13, 2026 at 5:20 pm

    If your action method parameter is named item, the DefaultModelBinder will look for item.name, item.title, item.content.width, etc. If it can’t find any *item.** in the request, it will ignore the item prefix and fall back to the empty prefix, looking just for name, title, content.width, etc.

    Chances are something else in the request is called item (or *item.**), which is causing this fallback logic not to occur. If you want to force the fallback logic, attribute the parameter with [Bind(Prefix = “”)], which says “yeah, I know this parameter was named item, but pretend its name is actually ”.”

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

Sidebar

Related Questions

I have a strongly-typed MVC View Control which is responsible for the UI where
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach
I have an application, built using MVC, that produces a view which delivers summary
I have an MVC view with a form built with the Ajax.BeginForm() helper method,
I have a custom view engine in ASP.NET MVC and since upgrading to RC1
Most of the MVC samples I have seen pass an instance of the view
I have a view that has a list of jobs in it, with data
I have a view using a master page that contains some javascript that needs
I have a blogpost edit page where you can either save your edits or
I have an asp.net view/page (dynamic) that is built up of nested Html.RenderPartials. The

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.