I have a gridview which contains few Template columns, In the first Template column , I have a LinkButton (Visible bydefault) and a Label(Hidden bydefault).
I have setup a property (IsPopup) on server side (aspx.cs file)
Now my requirement is to Show LinkButton and hide Label if IsPopup is true and vice versa.
Following is the code sample
aspx.cs code
public bool IsPopup
{
get;
set;
}
aspx code
<asp:GridView ID="gvEquipment" runat="server" AutoGenerateColumns="False" >
<Columns>
<asp:TemplateField HeaderText="ID" meta:resourcekey="TemplateFieldResource2">
<ItemTemplate>
<asp:Label ID="lblCheckPointCode" runat="server" meta:resourcekey="lblCheckPointCodeResource1"
Text='<%# Bind("CheckPointCode") %>' Visible="False"></asp:Label>
<asp:LinkButton ID="lbtnCheckPointCode" runat="server" CausesValidation="False" CommandName="Edit"
meta:resourcekey="lbtnCheckPointCodeResource1" Text='<%# Bind("CheckPointCode") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="25%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
In the above code you can see the Label is visible false bydefault.
When I tried to implement Visible='<# IsPopup '
following error appears: Parser Error Message: Cannot create an object of type 'System.Boolean' from its string representation '<# IsPopup ' for the 'Visible' property.