Connecting Tech Pros Worldwide Help | Site Map

Accessing Checkboxes in Repeater control

Imran Aziz
Guest
 
Posts: n/a
#1: Nov 19 '05
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.


Klaus H. Probst
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Accessing Checkboxes in Repeater control


Use the FindControl() function.


--
Klaus H. Probst, MVP
http://www.simulplex.net/


"Imran Aziz" <imran@tb2.net> wrote in message
news:eyCMrRrmFHA.3312@tk2msftngp13.phx.gbl...[color=blue]
> Hello All,
> I have added html checkboxes in each row of the repeater control that[/color]
I[color=blue]
> 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[/color]
how[color=blue]
> 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,[/color]
"sChannelTitle")[color=blue]
> %></a>
>
> </td>
>
> </tr>
>
> <tr >
>
> <td>
>
> <%# DataBinder.Eval(Container.DataItem, "sChannelDescription")%>
>
> </td>
>
> </tr>
>
> </ItemTemplate>
>
> <FooterTemplate>
>
> </Table>
>
> </FooterTemplate>
>
> </ASP:Repeater>
>
>
>
> Imran.
>
>[/color]


Imran Aziz
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Accessing Checkboxes in Repeater control


Got it thanks :)
Imran.
"Klaus H. Probst" <usenet001@simulplex.net> wrote in message
news:u0s4hHzmFHA.3380@TK2MSFTNGP12.phx.gbl...[color=blue]
> Use the FindControl() function.
>
>
> --
> Klaus H. Probst, MVP
> http://www.simulplex.net/
>
>
> "Imran Aziz" <imran@tb2.net> wrote in message
> news:eyCMrRrmFHA.3312@tk2msftngp13.phx.gbl...[color=green]
>> Hello All,
>> I have added html checkboxes in each row of the repeater control that[/color]
> I[color=green]
>> 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[/color]
> how[color=green]
>> 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,[/color]
> "sChannelTitle")[color=green]
>> %></a>
>>
>> </td>
>>
>> </tr>
>>
>> <tr >
>>
>> <td>
>>
>> <%# DataBinder.Eval(Container.DataItem, "sChannelDescription")%>
>>
>> </td>
>>
>> </tr>
>>
>> </ItemTemplate>
>>
>> <FooterTemplate>
>>
>> </Table>
>>
>> </FooterTemplate>
>>
>> </ASP:Repeater>
>>
>>
>>
>> Imran.
>>
>>[/color]
>
>[/color]


Closed Thread