【发布时间】:2016-02-25 08:19:22
【问题描述】:
<asp:Repeater ID="ReptServices" runat="server" OnItemDataBound="ReptServices_OnItemDataBound">
<b>
<td> <%# Eval("ApplicationSteps") %></td>
<td><%# Eval("Service.ServiceName") %></td>
<td>
<b><%# Eval("BeneficiaryUserUnitJob.User.NameAr") %> </b>
</td>
<td><%# Eval("DateCreated") %></td>
</b>
</asp:Repeater>
这个repeater在c#中填写为
ReptServices.DataSource = new ApplicationLogic(ApplicationType.Web).GetAllOutboxApplication(_currentUserUnitJob);
“ApplicationSteps”属性包含许多元素,其中包含另一个名为submitactiontypeid 的属性,如下图所示:
我想获取submitactiontypeid 的值,它存在于ApplicationSteps 的最后一个元素中
我问我要写什么<%# Eval("ApplicationSteps") %>
【问题讨论】:
-
那么你需要最后一个
RepeaterItem的Eval("ApplicationSteps")的值吗?在哪里? -
抱歉看不懂!!span>
-
不清楚你真正想要什么以及在哪里需要它。
-
这样的事情可能对你有帮助:
<%# Container.ItemIndex + 1 == Items.Count ? "this is the last item" : null %> -
似乎太懒了,但我尝试创建一个新的解决方案 :)
<%# Container.ItemIndex + 1 == Items.Count ? ((ApplicationSteps)Items[Container.ItemIndex]).SubmitActionTypeId : null %>
标签: c# html asp.net arrays repeater