如果条件在转发器项目模板中 [英] if condition in repeater item template

查看:90
本文介绍了如果条件在转发器项目模板中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,





我需要使用Eval检查转发器项目模板中的条件我是如何编写代码的..这个代码显示错误



Hai,


I need to check condtion inside the repeater item template using Eval How an i write the code ..this code showing error

<pre lang="xml"><asp:Repeater ID="r" runat="server" DataSourceID="SqlDataSource1">

<ItemTemplate>
<%# If(Convert.ToInt32(Eval("Id"))== "1"){ %>
<li ><a href="./" class="dir"><%# Eval("ModuleName")%></a>
<ul>
<li><a href="./">aaa</a></li>
<li><a href="./">bbbb</a></li>
</ul>
<%}else {%>
<ul>
<li><a href="./">hi hi hi</a></li>
</ul>
<%} %>
</li>

</ItemTemplate>







< / asp:Repeater>




</asp:Repeater>

推荐答案

如果在转发器控制中不起作用。您是否尝试使用Google寻求解决方案 - https://www.google.co.in/#q= if%20condition%20repeater [ ^ ]?通过讨论,我相信你会找到一个解决方案。
If doesn't work this way inside repeater control. Did you try Google for a solution - https://www.google.co.in/#q=if%20condition%20repeater[^]? Go through the discussions and I am sure you will find a solution.


这篇关于如果条件在转发器项目模板中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆