I needed to conditionally hide a delete button in a GridView. This data binding expression did the trick:
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False"
CommandName="Delete" ImageUrl="~/_Images/cross.png" Text="Delete"
Visible='<%# ((string)Eval("statuscodeLabel") == "Draft") %>' />
<asp:HyperLink ID="lnkCert" runat="server"
Visible='<%# SomeDAL.UserCanDoSomething(CType(Container.DataItem, System.Data.DataRowView).Item("Code").ToString()) %>'
NavigateUrl='<%# Eval("ID", "~/forms/AgencyForm.aspx?pid={0}&mode=cert") %>'>
<img src="../images/tick.png" alt="Certify Agency Data" /></asp:HyperLink>
No comments:
Post a Comment