Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MVC 3 的 Details 模板返回了一个视图<fieldset>,用于显示代表一列中所有字段的元素。但我需要在两列或多列中显示模型的元素或字段。有什么好的模板吗?你的建议是什么?
<fieldset>
这里没有关于 MVC 的具体内容。这只是普通的旧 html 和 css。我建议买一本关于 HTML 和 CSS 的好书,这些事情你会很清楚。
您可以使用的许多方法之一:
http://www.gethifi.com/blog/html-forms-the-right-ways
您正在寻找的是修改生成该视图的脚手架模板。
或者其他选项可以手动执行,检查“显示”每个模型的最佳方式。
您拥有的一种选择是使用 MVC 的编辑器模板,它允许您控制如何生成模型的 html 呈现。这是一个带有示例的博客文章
在 MVC 3 中使用 EditorTemplates