Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

if statement inside Repeater ItemTemplate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oleg - 07 Mar 2008 15:21 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.