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

Accessing Checkboxes in Repeater control

Hello All,
I have added html checkboxes in each row of the repeater control that I
draw on the page. Now when I wan to find out if the check boxes have been
checked or not, I cannot seem to access them. Can anyone please guide me how
to access child items in a repeater control.

Here is my code.

<ASP:Repeater id="lstOtherRepeater" runat="server" >

<HeaderTemplate>

<Table width="100%" >

</HeaderTemplate>

<ItemTemplate>

<tr >

<td>

<input id="chkChannelID" type="checkbox" value="<%#
DataBinder.Eval(Container.DataItem, "nChannelID") %>"/><a
href="showitems.aspx?nChannelID=<%# DataBinder.Eval(Container.DataItem,
"nChannelID") %>" ><%# DataBinder.Eval(Container.DataItem, "sChannelTitle")
%></a>

</td>

</tr>

<tr >

<td>

<%# DataBinder.Eval(Container.DataItem, "sChannelDescription")%>

</td>

</tr>

</ItemTemplate>

<FooterTemplate>

</Table>

</FooterTemplate>

</ASP:Repeater>

Imran.
Nov 19 '05 #1
2 1659
Use the FindControl() function.
--
Klaus H. Probst, MVP
http://www.simulplex.net/
"Imran Aziz" <im***@tb2.net> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Hello All,
I have added html checkboxes in each row of the repeater control that I draw on the page. Now when I wan to find out if the check boxes have been
checked or not, I cannot seem to access them. Can anyone please guide me how to access child items in a repeater control.

Here is my code.

<ASP:Repeater id="lstOtherRepeater" runat="server" >

<HeaderTemplate>

<Table width="100%" >

</HeaderTemplate>

<ItemTemplate>

<tr >

<td>

<input id="chkChannelID" type="checkbox" value="<%#
DataBinder.Eval(Container.DataItem, "nChannelID") %>"/><a
href="showitems.aspx?nChannelID=<%# DataBinder.Eval(Container.DataItem,
"nChannelID") %>" ><%# DataBinder.Eval(Container.DataItem, "sChannelTitle") %></a>

</td>

</tr>

<tr >

<td>

<%# DataBinder.Eval(Container.DataItem, "sChannelDescription")%>

</td>

</tr>

</ItemTemplate>

<FooterTemplate>

</Table>

</FooterTemplate>

</ASP:Repeater>

Imran.

Nov 19 '05 #2
Got it thanks :)
Imran.
"Klaus H. Probst" <us*******@simulplex.net> wrote in message
news:u0**************@TK2MSFTNGP12.phx.gbl...
Use the FindControl() function.
--
Klaus H. Probst, MVP
http://www.simulplex.net/
"Imran Aziz" <im***@tb2.net> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Hello All,
I have added html checkboxes in each row of the repeater control that

I
draw on the page. Now when I wan to find out if the check boxes have been
checked or not, I cannot seem to access them. Can anyone please guide me

how
to access child items in a repeater control.

Here is my code.

<ASP:Repeater id="lstOtherRepeater" runat="server" >

<HeaderTemplate>

<Table width="100%" >

</HeaderTemplate>

<ItemTemplate>

<tr >

<td>

<input id="chkChannelID" type="checkbox" value="<%#
DataBinder.Eval(Container.DataItem, "nChannelID") %>"/><a
href="showitems.aspx?nChannelID=<%# DataBinder.Eval(Container.DataItem,
"nChannelID") %>" ><%# DataBinder.Eval(Container.DataItem,

"sChannelTitle")
%></a>

</td>

</tr>

<tr >

<td>

<%# DataBinder.Eval(Container.DataItem, "sChannelDescription")%>

</td>

</tr>

</ItemTemplate>

<FooterTemplate>

</Table>

</FooterTemplate>

</ASP:Repeater>

Imran.


Nov 19 '05 #3

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

Similar topics

3
by: Mark | last post by:
I am looking for an example of using checkboxes in a repeater control where the checkbox state is persisted from page to page. Thank you, Mark
4
by: John Holmes | last post by:
I'm using data to rename some web controls on a form that uses a repeater contol and so it can have mulitple instances of the same control set. The controls get renamed (thanks to Steven Cheng's...
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: Brian Vallelunga | last post by:
I have a repeater bound to a datatable. For each item in the data table, I need a set of known checkboxes to show up. This is easy to do, but I am not sure how to get the results of the checkboxes...
0
by: Demetri | last post by:
Guys, If you have a repeater and EnableViewState is false and the repeater has a checkbox control in each item and alternating item (row) how do you capture which checkboxes were checked by the...
1
by: Dave | last post by:
I have the following ASP.NET 2.0 code (simplified here for ease): <asp:Repeater id="SearchResultsRepeater" runat="server"> <ItemTemplate> <uc:SearchResult ID="SearchResult"...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
4
by: John Kotuby | last post by:
Hi all, I am using a Repeater in conjunction with a SQLDatasource and SQL Server. One of the controls in the repeater is a HyperlLink as follows: <asp:HyperLink...
3
by: =?Utf-8?B?QXR1bCBSYW5l?= | last post by:
I want to find whether user selected any checkbox or not. these CheckBoxes are in Repeater. I am doing code in c#.net.
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:
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.