PC Review


Reply
Thread Tools Rate Thread

Accessing Checkboxes in Repeater control

 
 
Imran Aziz
Guest
Posts: n/a
 
      6th Aug 2005
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.


 
Reply With Quote
 
 
 
 
Klaus H. Probst
Guest
Posts: n/a
 
      7th Aug 2005
Use the FindControl() function.


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


"Imran Aziz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
Imran Aziz
Guest
Posts: n/a
 
      8th Aug 2005
Got it thanks
Imran.
"Klaus H. Probst" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Use the FindControl() function.
>
>
> --
> Klaus H. Probst, MVP
> http://www.simulplex.net/
>
>
> "Imran Aziz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Delete Command from a button in a Repeater Control MU Microsoft ASP .NET 0 20th Jan 2009 01:00 AM
Accessing checkbox properties in a repeater control =?Utf-8?B?S2VpdGg=?= Microsoft VB .NET 0 8th Jun 2006 09:25 PM
Accessing child controls of a nested repeater control Charlie@CBFC Microsoft ASP .NET 1 7th Oct 2005 04:22 PM
Need help in accessing a control embedded in a repeater =?Utf-8?B?cmVkbW9uZA==?= Microsoft ASP .NET 2 6th Jan 2005 05:23 PM
Accessing a Control inside a Repeater from a code behind file Ric Microsoft ASP .NET 9 3rd Mar 2004 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:15 PM.