using .net 2.0
Trying to put condition on current value in repeater in this manner:
<% if(<%# DataBinder.Eval(Container.DataItem, "FROM_NET") != "Hourly
Rate")%> %>
<asp:TextBox Value='<%# DataBinder.Eval(Container.DataItem, "DELIVERY")
%>' runat="server"/>
<% else %>
<asp:Label Text='<%# DataBinder.Eval(Container.DataItem, "DELIVERY") %>'
runat="server"/>
Of course that doesn't work.
Please, need some help may be with syntax or work around for this problem.
Thanks,
Oleg
Cowboy (Gregory A. Beamer) - 07 Mar 2008 15:53 GMT
When you need complex logic on each row bound to a control, use the Data
Binding event for that control. It allows you to do tests and intercept as
needed. Example here:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.item
databound.aspx

Signature
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box!
*************************************************
> using .net 2.0
> Trying to put condition on current value in repeater in this manner:
[quoted text clipped - 10 lines]
> Thanks,
> Oleg