1
ASP.NET 웹 양식의 간단한 메시지 보드를 개발 중이며 ListView 컨트롤러의 모든 게시물을 나열합니다. 내 코드는 다음과 같습니다.ListView의 항목에 대한 동적 ID 속성
<ItemTemplate>
<article class="post">
<div class="postinfo">
<div class="postauthor">
Author: <strong><%# Eval("Author") %></strong>
</div>
<div class="postdate">
Date: <strong><%# Eval("PostDate", "{0:D}") %></strong>
</div>
<div class="postvotes">
<asp:Button class="postupvote" id='up<%# Eval("Id") %>' runat="server" />
<asp:Label ID="postvotescount_<%# Eval("Id") %>" class="postvotescount" runat="server" Text="<%# Eval("Votes") %> votes"></asp:Label>
<asp:Button class="postdownvote" id='down<%# Eval("Id") %>' runat="server" />
</div>
</div>
<div class="postcontent"><%# Eval("Text") %></div>
</article>
</ItemTemplate>
내 투표 기능이 문제입니다. 게시물의 고유 한 데이터베이스 ID를 포함하는 CSS 속성을 갖고 싶습니다. 그런 식으로 나는 그 이드의 이드를 알게 될 것이고, 그것은 표결되었다. 이것이 가능합니까? 그렇다면 어떻게 할 수 있습니까?
감사합니다.
감사합니다. 정확히 필요한 것! :) – Raisolution