我渲染我的 ViewModel
创建.cshtml:
@using (Html.BeginForm("Create","TestTemplate")) {
@Html.EditorForModel()
}
我不喜欢输出内容,因为所有 div 都在另一个之下。如果我想要一个水平布局,其中一个 div 向左浮动到另一个 div 怎么办?
当我的 Create.cshtml 视图中没有 html 时,如何使用 EditorForModel() 帮助程序修改此类布局更改?
更新:
为什么我必须创建两个视图。在我在另一个 EditorTemplate-view 中调用 @Html.EditorForModel() 的那个中,我做了所有的布局工作,我也可以通过 EditorFor( x => x....) 在第一个视图中做这些工作?这对我来说似乎很奇怪。