I have a view containing usercontrol. User control is displayed using:
<% Html.RenderPartial("GeneralStuff", Model.General, ViewData); %>
My problem is that usercontrol displays the values from the model perfectly, but when I publish the values edited in usercontrol, they do not map to the model. General . I know that I can find the values in Request.Form, but I really thought that MVC would be able to match these values with the model.
My user control:
<%@ 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 am using .Net MVC 2
Thanks for any help!
source
share