여기에 내 현재 뷰 코드입니다 :MVCContrib, Html.Grid : td 태그에 행 기반 ID를 첨부하려면 어떻게해야합니까?
<% Html.Grid((List<ColumnDefinition>)ViewData["Parameters"])
.Columns(column =>
{
column.For(c => c.ID);
column.For(c => c.Name);
}).Render();
%>
내가 같은 각각의 "이름"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>
내 질문 :
어떻게해야합니까?
나는 '속성'확장 방법을 고려했지만 어떻게 작동 시킬지 확신하지 못했습니다. 지정된 HTML를 렌더링하는
Jim, 나는 실제로 그것을 얻었고 편집 된 대답을 확인했다. –
@Josh Pearce : 아직 답을 얻을 수 없습니다. 제 3 자의 의견이 있으면 좋을 것입니다. –