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.
我担心我错过了显而易见的事情,但我一直无法找到如何在 Razor 视图中显示 Visual Basic DataTable 对象。有没有办法将 DataTable 的行/列元素更改为所需的格式。
我正在使用 Visual Studio Professional 2012。
谢谢
这对我有用。我已经做了一天 MVC/Razor。似乎比@dan-o 的链接解决方案复杂得多
<table> @For Each row In Model.myDataTable.Rows @<tr> <td>@row("col1") </td> <td>@row("col2") </td> </tr> Next </table>