The easiest way to do this is to use a code-behind approach. In your 'ItemDataBound' event of the 'ListView', you can find the 'PlaceHolder' control and set its visibility accordingly -
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
PlaceHolder purchaseButtonPlaceholder = (PlaceHolder)e.Item.FindControl("purchasebutton");
Label ticketIdLabel = (Label)e.Item.FindControl("Label2");
if (ticketIdLabel.Text.Trim().ToLower() == "dbbull")
{
purchaseButtonPlaceholder.Visible = true;
}
else
{
purchaseButtonPlaceholder.Visible = false;
}
}
}
In your ASPX page, you need to attach this event handler to your 'ListView' -
<asp:ListView ID="ListView1" runat="server" DataKeyNames="raffleID" DataSourceID="SqlDataSource1" GroupItemCount="3" OnItemDataBound="ListView1_ItemDataBound">
<!-- Your current ListView markup code here... -->
</asp:ListView>