Hello,
I've a problem with my viewmodel. I've a DropDownList with many translationvalues (pattern here)
In My controller - HTTPGET :
public ActionResult Edit(int id) {
int DropDownListValueId = id;
SelectListViewModel viewmodel = new SelectListViewModel(0, DropDownListValueId);
return View(viewmodel);
}
In My view :
<% using (Html.BeginForm())
{%>
<%: Html.ValidationSummary(true)%>
<fieldset>
<legend>Fields</legend>
<%foreach (var item in Model.DropDownListValue.DropDownListValue_Translation)
{%>
<%: Html.TextBoxFor(model => item.Name) %><br />
<% } %>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
<% } %>
In my controller, HTTPPOST :
[HttpPost]
public ActionResult Edit(SelectListViewModel viewmodel)
{
return View();
}
My problem : data not passed in httppost, I think the problem is foreach in view??
Thank you,
Lore