I tried to generate a view for file upload but the upload part was missing and the rest class members have view generated for them
View Model
namespace myapps.Models.ViewModels
{
public class UserPhotoUploadViewModel
{
public HttpPostedFile PhotoFile
{
get;
set;
}
public Guid UserID
{
get;
set;
}
}
}
Generated View
@model myapps.Models.ViewModels.UserPhotoUploadViewModel
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>UserPhotoUploadModel</legend>
<div class="editor-label">
@Html.LabelFor(model => model.UserID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.UserID)
@Html.ValidationMessageFor(model => model.UserID)
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
Am I expected to fill in the rest? Is this a usual behaviour and are there limit to what asp.net MVC3 could generate?