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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:52:05+00:00 2026-05-14T18:52:05+00:00

I have a View that contains a usercontrol. The usercontrol is rendered using: <%

  • 0

I have a View that contains a usercontrol. The usercontrol is rendered using:

<% Html.RenderPartial("GeneralStuff", Model.General, ViewData); %>

My problem is that the usercontrol renders nicely with values from the model but when I post values edited in the usercontrol they are not mapped back to Model.General. I know I can find the values in Request.Form but I really thought that MVC would manage to map these values back to the model.

My usercontrol:

 <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<namespace.Models.GeneralViewModel>" %>

<fieldset>        
    <div>
        <%= Html.LabelFor(model => model.Value)%>
        <%= Html.TextBoxFor(model => model.Value)%>            
    </div>
</fieldset>

I’m using .Net MVC 2

Thanks for any help!

  • 1 1 Answer
  • 1 View
  • 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-14T18:52:06+00:00Added an answer on May 14, 2026 at 6:52 pm

    Problem solved!

    My usercontrol is rendered with:

    <%= Html.EditorFor(model => model.General); %>
    

    My model looks like this:

    public class TestEditViewModel
    {
        [UIHint("GeneralViewModel")]
        public GeneralViewModel General { get; set; }
    }
    

    And my usercontrol is placed under Views->Shared->EditorTemplates and named “GeneralViewModel.ascx”

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

Sidebar

Related Questions

I have a MVC view that contains some dropdowns like this : <%: Html.DropDownListFor(model
I have one grid view that contains some template columns. In this, the first
We have a modal view that contains a Table view that contains UITableViewCells used
I'm brand new to MVC and have just come across a scenario that I
I have a user control which contains a number of child controls. I want
I'm using ajax in my website to call some information from a UserControl called
I'm using the Razor view engine with MVC3 RC1 and Razor, and running through
I put a ListView in the middle row of a View. The view is
So I have been doing this awhile now and have run into a really
I'm trying to perform two-way data binding on the controls in my user control,

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.