【发布时间】:2010-12-17 15:39:12
【问题描述】:
这是我当前的视图代码:
<% Html.Grid((List<ColumnDefinition>)ViewData["Parameters"])
.Columns(column =>
{
column.For(c => c.ID);
column.For(c => c.Name);
}).Render();
%>
我想为每个“name”td 标签附加一个 HTML“id”属性:
<table class="grid">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr class="gridrow">
<td>1</td>
<td id="parameter_1">Address</td>
</tr>
<tr class="gridrow_alternate">
<td>2</td>
<td id="parameter_2">Phone Number</td>
</tr>
</tbody>
</table>
我的问题:
我该怎么做?
我考虑过“属性”扩展方法,但不确定如何使其发挥作用。
【问题讨论】:
标签: asp.net-mvc attributes grid mvccontrib