【发布时间】:2014-07-27 11:14:38
【问题描述】:
我正在尝试使用带有 Kendo 网格编辑弹出窗口的复杂模型。提交 ALResults 对象属性时始终为空。当我不使用剑道时,它工作得很好。剑道复杂模型提交有问题吗?
public class InitialApplicantLevel2Model
{
public InitialApplicantLevel2Model()
{
alResultsModel = new ALResults();
}
public int InitialApplicantLevel2ID { get; set; }
public string ApplicantName { get; set; }
public string ContactNumber { get; set; }
public string School { get; set; }
[Required(ErrorMessage="Ref No. required.")]
public int? EnquiryID { get; set; }
public ALResults alResultsModel { get; set; }
}
public class ALResults
{
public int ResultsID { get; set; }
public int InitialApplicantLevel2ID { get; set; }
public string Stream { get; set; }
public string Grading { get; set; }
public string IndexNo { get; set; }
public int? Year { get; set; }
public int? Attempt { get; set; }
public double? ZScore { get; set; }
public string Medium { get; set; }
}
@model SIMS.Models.StudentIntake.InitialApplicantLevel2Model
<tr>
<td>Year: </td>
<td>@Html.TextBoxFor(o=>o.alResultsModel.Year)</td>
<td>Index No: </td>
<td>@Html.TextBoxFor(o=>o.alResultsModel.IndexNo)</td>
<td>Medium: </td>
<td>@Html.TextBoxFor(o=>o.alResultsModel.Medium)</td>
</tr>
<tr>
<td>Stream: </td>
<td>@Html.TextBoxFor(o=>o.alResultsModel.Stream)</td>
<td>Attempt: </td>
<td>@Html.TextBoxFor(o=>o.alResultsModel.Attempt)</td>
<td>Zscore: </td>
<td>
@Html.TextBoxFor(o=>o.alResultsModel.ZScore)
</td>
</tr>
【问题讨论】:
标签: asp.net-mvc kendo-ui kendo-grid