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

Repeater Item?

Assume that a Repeater control displays 2 columns in a HTML table (i.e.
using <tr><tdetc.) - Name & Phone no. All the items under the "Name"
column are LinkButtons. To retrieve the index of the item clicked, this
is what I did:

<script runat="server">
Sub ComItem(ByVal obj As Object, ByVal ea As
RepeaterCommandEventArgs)
Response.Write(ea.Item.ItemIndex)
End Sub
</script>
<form runat="server">
<asp:Repeater ID="rptrUsers" OnItemCommand="ComItem" runat="server">
<HeaderTemplate>
<table border="1">
<tr>
<th>NAME</th>
<th>PHONE NUMBER</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
...................
...................
...................
</asp:Repeater>
</form>

The above code retrieves the ItemIndex but how do I get the actual data
of the item that the user has clicked?

For e.g. assume that the first 3 items under the "Name" column are,
say, Clive, Vivian & Maria. Now when the user clicks Vivian, the
Response.Write line should output "Vivian" or if the user clicks Maria,
the Response.Write line should output "Maria". How do I do this?

Thanks,

Arpan

Aug 13 '06 #1
1 1706
Arpan got through this article by Karl
http://openmymind.net/index.aspx?documentId=8
Hope that helps
Patrick
"Arpan" <ar******@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Assume that a Repeater control displays 2 columns in a HTML table (i.e.
using <tr><tdetc.) - Name & Phone no. All the items under the "Name"
column are LinkButtons. To retrieve the index of the item clicked, this
is what I did:

<script runat="server">
Sub ComItem(ByVal obj As Object, ByVal ea As
RepeaterCommandEventArgs)
Response.Write(ea.Item.ItemIndex)
End Sub
</script>
<form runat="server">
<asp:Repeater ID="rptrUsers" OnItemCommand="ComItem" runat="server">
<HeaderTemplate>
<table border="1">
<tr>
<th>NAME</th>
<th>PHONE NUMBER</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
..................
..................
..................
</asp:Repeater>
</form>

The above code retrieves the ItemIndex but how do I get the actual data
of the item that the user has clicked?

For e.g. assume that the first 3 items under the "Name" column are,
say, Clive, Vivian & Maria. Now when the user clicks Vivian, the
Response.Write line should output "Vivian" or if the user clicks Maria,
the Response.Write line should output "Maria". How do I do this?

Thanks,

Arpan

Aug 13 '06 #2

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

Similar topics

0
by: kamaumalone | last post by:
I have a dropdownlist which lives inside of a repeater. The repeater accepts user input via textboxes and the aforementioned dropdownlist. The repeater accepts phone numbers and allows for an...
1
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
7
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
1
by: jeremystein | last post by:
With nested repeaters, how can I access the outer repeater's DataItem from the inner repeater? Here's a snippet from my aspx: <asp:repeater id="OuterRepeater" runat="server"...
4
by: sck10 | last post by:
Hello, I have a repeater that is bound to a SQL Server table. I would like to place a summary in the footer for the item count and product cost. I have two fields. One for the product name...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
1
by: Big Charles | last post by:
I have inner Repeater2 inside Repeater1. Problem is that I can't show the data of Repeater2 properly What is shown on Screen is: Line_1 Of Repeater_2 Line_2 Of Repeater_2 Line_3 Of...
5
by: Brad Baker | last post by:
I am trying to make a "tabbed" interface by iterating through a dataset with a conditional statement. For example: ...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
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:
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...

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.