M
maflatoun
Hi,
I have a datagrid and based on a condition I like to display either a
asp:textbox or asp:label. How would I do that? I have the following
<asp:TemplateColumn HeaderText="Qty">
<ItemTemplate>
<% if (DataBinder.Eval(Container.DataItem, "DynamicAttribute") = "No")
{%>
<asp:textbox id="tbxQtyNew" BackColor='<%#
SetTextBoxColor(DataBinder.Eval(Container.DataItem,
"DynamicAttribute")) %>' runat="server" text='1' />
<% } else { %>
<asp:Label id="lblQtyDisp" Text="1" runat="server"/>
<% } %> </ItemTemplate>
</asp:TemplateColumn>
Which fails. Any idea?
Thanks
Maz.
I have a datagrid and based on a condition I like to display either a
asp:textbox or asp:label. How would I do that? I have the following
<asp:TemplateColumn HeaderText="Qty">
<ItemTemplate>
<% if (DataBinder.Eval(Container.DataItem, "DynamicAttribute") = "No")
{%>
<asp:textbox id="tbxQtyNew" BackColor='<%#
SetTextBoxColor(DataBinder.Eval(Container.DataItem,
"DynamicAttribute")) %>' runat="server" text='1' />
<% } else { %>
<asp:Label id="lblQtyDisp" Text="1" runat="server"/>
<% } %> </ItemTemplate>
</asp:TemplateColumn>
Which fails. Any idea?
Thanks
Maz.