473,382 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Repeater, conditional logic

Hi

I have bound data to a Repeater control. How can I do something like this
(below is the desired logic only, it doesn't actually work):

<ItemTemplate>
<%if (Convert.ToBoolean(DataBinder.Eval(Container.DataI tem, "IsShowImage")))
{%>
<img src="image.jpg" />
<%}%>
<ItemTemplate>

Rasika.
Nov 19 '05 #1
2 2249
check this out:
http://openmymind.net/index.aspx?documentId=8

specifically:
http://openmymind.net/index.aspx?documentId=8#4

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Rasika WIJAYARATNE" <Ra***************@discussions.microsoft.com> wrote in
message news:7D**********************************@microsof t.com...
Hi

I have bound data to a Repeater control. How can I do something like this
(below is the desired logic only, it doesn't actually work):

<ItemTemplate>
<%if (Convert.ToBoolean(DataBinder.Eval(Container.DataI tem,
"IsShowImage")))
{%>
<img src="image.jpg" />
<%}%>
<ItemTemplate>

Rasika.

Nov 19 '05 #2
Thank you very much.

Rasika.

"Karl Seguin" wrote:
check this out:
http://openmymind.net/index.aspx?documentId=8

specifically:
http://openmymind.net/index.aspx?documentId=8#4

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Rasika WIJAYARATNE" <Ra***************@discussions.microsoft.com> wrote in
message news:7D**********************************@microsof t.com...
Hi

I have bound data to a Repeater control. How can I do something like this
(below is the desired logic only, it doesn't actually work):

<ItemTemplate>
<%if (Convert.ToBoolean(DataBinder.Eval(Container.DataI tem,
"IsShowImage")))
{%>
<img src="image.jpg" />
<%}%>
<ItemTemplate>

Rasika.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Oleg | last post by:
I am using asp:repeater control. I would like to create a conditional row <tr> when the data in DataBinder.Eval(Container.DataItem, "Activity") returns '1'. I need something like this: <%if(...
8
by: darrel | last post by:
*sigh*...I've asked this before, but have long forgotten the answer. In the past, I'd often use repeater controls, bind data to it, and then reference the data fields from within the repeater: ...
3
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and...
2
by: Mike Cain | last post by:
Hi, The Repeater control seems like exactly what I want to output rows of data from my database. However I need to do some manipulation to the data prior to it being output and I'm not...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
7
by: Brad Baker | last post by:
I am trying to programmatically set a placeholder control in csharp which is nested inside a repeater control between <ItemTemplateand </ItemTemplate> tags, however I am running into problems. I've...
3
by: Darrel | last post by:
I go back and forth between repeater controls and just using good ol' string builders to build formatted output from a db query. I'm working on a project where I'd really like to keep all the...
4
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
2
by: Hong | last post by:
Hi, I have been scratching my head over this problem for hours, the repeater control I am using would only render the controls specified in HeaderTemplate and FooterTemplate, but the repeater...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.