I'm using MVC3 and passing a adminEditViewModel viewmodel to my view:
public class adminEditViewModel
{
public Answer Answer { get; set; }
public string abc { get; set; }
}
The Class Answer looks like this:
public class Answer
{
public string[] ImageFile;
}
In the view I use this:
@Html.EditorFor(model => @Model.Answer.ImageFile[@index])
When it's on the page it looks like this:
<div class="editor-field">
<input class="text-box single-line" id="Answer_ImageFile_0_" name="Answer.ImageFile[0]" type="text" value="" />
</div>
When it's returned to the controller with the viewmodel above as a parameter I add some data, set a debug point, click submit and then see that Answer class in the viewdata contains null but other things such as abc are correctly set.
My question is can I even return data through a viewmodel from an array like this in the normal way?
Hope for some good advice