public class StepModel
{
public FirstStepModel m1 { get; set; }
public SecondStepModel m2 { get; set; }
public ThirdStepModel m3 { get; set; }
public FourthStep m4 { get; set; }
}
在视图中
@using (Html.BeginForm("SecondStep","Steps",FormMethod.Post))
{
@Html.HiddenFor(model => model.m1)>===>Not holding M1 type object giving null value when I posted it is working fine if use m1.property
@Html.EditorFor(model => model.m2.secondStepProp)
<input type="submit" value="Next"/>
}
请让我知道如何使用hidden来保存m1类型而不是m1.Prop