我有两个asp:ImageButton。我想隐藏asp:ImageButton ID="ReceiveButton"
每个表格单元格,只有如何在ASP.NET DataList控件中设置控件的可见性?
"<%#Eval("StatusID")=="123" %> "
像这样
我不知道如何写在.aspx文件这个条件语句。我的代码是这样的。
<td>
<%#Eval("StatusID")%>
</td>
<td align="center">
<asp:ImageButton ID="ReceiveButton" ToolTip="Receive/process this aproved PO" runat="server"
ImageUrl="~/DesktopModules/HBI_PurchaseOrder/Assets/Images/receive.png"
CommandName="CommandReceived" />
<asp:ImageButton ID="DetailButton" ToolTip="View Approved PO" runat="server"
ImageUrl="~/DesktopModules/HBI_PurchaseOrder/Assets/Images/view.png" CommandName="PODetails" />
</td>
我想是这样,
<td>
<%#Eval("StatusID")%>
</td>
<td align="center">
<%if (Eval("StatusID") == "123") { %>
<asp:ImageButton ID="ReceiveButton" ToolTip="Receive/process this aproved PO" runat="server"
ImageUrl="~/DesktopModules/HBI_PurchaseOrder/Assets/Images/receive.png"
CommandName="CommandReceived" />
<%} %>
<asp:ImageButton ID="DetailButton" ToolTip="View Approved PO" runat="server"
ImageUrl="~/DesktopModules/HBI_PurchaseOrder/Assets/Images/view.png" CommandName="PODetails" />
</td>
但它不工作。如何正确设置条件?请帮帮我。
它的工作原理!谢谢! – Jarich 2014-10-01 06:46:44
很高兴帮助你:) – Pawan 2014-10-01 06:48:17