473,564 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ToBool ean(DataBinder. Eval(Container. DataItem, "IsShowImage")) )
{%>
<img src="image.jpg" />
<%}%>
<ItemTemplate >

Rasika.
Nov 19 '05 #1
2 2251
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******** *************** ***********@mic rosoft.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.ToBool ean(DataBinder. Eval(Container. DataItem,
"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******** *************** ***********@mic rosoft.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.ToBool ean(DataBinder. Eval(Container. DataItem,
"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
2058
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( Convert.ToString(DataBinder.Eval(Container.DataItem, "Activity")) == "1") { %>...<%}%> My attempts putting 'DataBinder.Eval(Container.DataItem,...
8
2375
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: <%# DataBinder.Eval(Container.DataItem, "agentMobilePhone") %> More recently, I've been doing more of the building on the codebehind side,...
3
2841
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 creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds...
2
2165
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 understanding how to go about this properly. For instance, the db column "myVal" is defined as a double in the db. In my table I want to display the...
7
2993
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 attempting to bind a user control I've written, "ImageBox", to a repeater. The user control takes a custom property, "ContentID", that will execute...
7
9070
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 tried several different approaches for finding the placeholder: This: MyControl = this.FindControl("$form$tabs_repeater$PlaceHolder1"); ...
3
1267
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 formatting markup on the front-end for the non-.net folks to be able to updates. Obvioudly, a repeater control makes a lot of sense for this. The...
4
15368
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
1854
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 will not render the controls in ItemTemplate and AlternateItemTemplate. ItemDataBound event is fired appropriately, just the rendering seems to be...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.