I am wanting to set the visibility of a ASP:LINKBUTTON based on the condition of the Repeaters DataSource property TYPE
if the DataItem.Type property == "practical" set visibility to true otherwise false;
Obviously some rows in the datasource will be true and some will be false, i only want to to hide the current row not all buttons.
I have tried the below code:
Visible="<%# DataBinder.Eval(Container,"DataItem.Type").ToString().ToLower() == "practical" ? true : false %>"
i have also tried the values true and false in speech marks but to no prevail:
error i recieve is:
Parser Error Message: The server tag is not well formed.
Source Error:
Line 84: </td>
Line 85: <td width="17%">
Line 86: <asp:LinkButton runat="server" ID="lbAddDates" Visible="<%# DataBinder.Eval(Container,"DataItem.Type").ToString().ToLower() == "practical" ? "true" : "false" %>" CommandName="AddDates" OnCommand="lbCourseActionItems_Click" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.Id").ToString() + "," + DataBinder.Eval(Container, "DataItem.IsActive").ToString() + "," + DataBinder.Eval(Container, "DataItem.Title").ToString() %>' class="button">
</asp:LinkButton>
Any help on this would be greatly appreciated.