标签:
@model MvcFirstDemo.Models.UserInfo--数据库数据
@using System.Data;
<div>
@{ DataTable dt = ViewData["tt"] as DataTable;}
<table>
<tr>
<th>用户ID</th><th>姓名</th><th>年龄</th>
</tr>
@foreach (DataRow dr in dt.Rows)
{
<tr>
<td> @dr["Id"]</td>
<td> @dr["Name"]</td>
<td> @dr["Age"]</td>
</tr>
}
</table>
</div>
标签:
原文地址:http://www.cnblogs.com/cococool/p/4670901.html