ASP MVC 3中一个视图中的两种模型
public class Person{ public int PersonID { get; set; } public string PersonName { get; set; }}public class Order{ public int OrderID { get; set; } public int TotalSum { get; set; }}
@model _try2models.Models.Person@model _try2models.Models.Order@using(Html.BeginForm()){ @Html.EditorFor(x => x.PersonID) @Html.EditorFor(x => x.PersonName) @Html.EditorFor(x=>x.OrderID) @Html.EditorFor(x => x.TotalSum)}
繁星coding