473,379 Members | 1,245 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,379 software developers and data experts.

Include code inside repeater

Hi,

I want to do add an if statement (C#) inside my itemtemplate.

Something like this:
<ItemTemplate>
IF (true)
...<td><asp:HyperLink...
ELSE
...<td><asp:HyperLink...
</ItemTemplate>

How can I do this?

Thanks!
Nov 19 '05 #1
2 1131
The way of doing this sort of things is to put all controls in the template
and hide/show them by either databinding Visible property or setting Visible
property in ItamDataBound event.

Eliyahu

"Arjen" <bo*****@hotmail.com> wrote in message
news:dc**********@news2.zwoll1.ov.home.nl...
Hi,

I want to do add an if statement (C#) inside my itemtemplate.

Something like this:
<ItemTemplate>
IF (true)
...<td><asp:HyperLink...
ELSE
...<td><asp:HyperLink...
</ItemTemplate>

How can I do this?

Thanks!

Nov 19 '05 #2
You can learn more at:
http://openmymind.net/index.aspx?documentId=8

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!)
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
The way of doing this sort of things is to put all controls in the
template
and hide/show them by either databinding Visible property or setting
Visible
property in ItamDataBound event.

Eliyahu

"Arjen" <bo*****@hotmail.com> wrote in message
news:dc**********@news2.zwoll1.ov.home.nl...
Hi,

I want to do add an if statement (C#) inside my itemtemplate.

Something like this:
<ItemTemplate>
IF (true)
...<td><asp:HyperLink...
ELSE
...<td><asp:HyperLink...
</ItemTemplate>

How can I do this?

Thanks!


Nov 19 '05 #3

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

Similar topics

9
by: Ric | last post by:
im new to asp.net. please help if u can. is it possible to refer to a control(ie lable, placeholder, textbox) that is inside a repeater object from a code behind file? when i place the control...
1
by: Bennett Haselton | last post by:
If I have this code for repeater, it gives a compilation error saying "The type or namespace name 'MyValue2' could not be found": <asp:Repeater id="MyList" runat="server"> <ItemTemplate>...
5
by: Guoqi Zheng | last post by:
Dear sir, If I need to use a function on xxx.aspx page, e.g. on a repeater control, I have to define this function inside xxx.aspx.vb file, if I put it in the module class, it will not work so I...
4
by: huzz | last post by:
I am trying to access a DropDownList control inside a repeater using ItemCommand as shown below but for some reason i can't access the DropDownList. When i step through the debug i get <undefine...
5
by: Matt Jensen | last post by:
Am I right in saying that you can't have a Radiobutton web control inside a repeater bound to a database datasource and (inline) dynamically set it's ID and text properties from the repeaters rows?...
1
by: Neo Geshel | last post by:
I am having conflicting results with two pieces of identical code. One is an insert, the other is an update to a db. The first code, which works, is this: Sub Add3_Click(sender As Object, e As...
2
by: Nobody | last post by:
I have an aspx page where I have a repeater control that repeats a asp:LinkButton. When I click on one of the links, I get a post back, and the page flashes. A friend told me to look into ATLAS/AJAX,...
6
by: Doogie | last post by:
I have a Repeater control in an app I'm updating. I need to write code (event method) when a user clicks on one of the columns in the control. But there is no method like "Repeater_OnClick" or...
1
by: HockeyFan | last post by:
protected void gvAuthorizedSigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EmptyInsert") { odsAuthorizedSigners.Insert(); return; } if (e.CommandName...
1
by: Øyvind Isaksen | last post by:
I need to know how to handle controls inside a repeater, how to send and recieve data from another page to one spesific control inside a repeater. Clue: I have a repeater that dynamicly lists...
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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.