Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Iterate through check boxes on a repeater control in code behind
Simes
Mar 25 2006 6:22 AM
2.4k
Reply
Hi,
I am new to web development and would appreciate some help here. I am dynamic creating check boxes through ASP.net and would like to know how I iterate through them in my code behind to know which ones have been chceck and unchecked. please help if you can. Below is a code snippet from the ASPx part:
<
asp
:
repeater
id
=rptBelbinMaster
runat
="server">
<
headertemplate
>
<
table
class
="datagridNormal"
width
="100%"
border
="1"
>
<
tr
>
<
th
align
="Left">
Question Code
</
th
>
<
th
align
="Left">
Question
</
th
>
</
tr
>
</
headertemplate
>
<
itemtemplate
>
<
tr
class
="datagridNormal"
width
="100%">
<
td
align
="Left">
<%
#
DataBinder
.Eval(Container.DataItem,
"prpQuestionCode"
)%>
</
td
>
<
td
align
="Left"
width
="90%">
<%
#
DataBinder
.Eval(Container.DataItem,
"prpQuestionText"
)%>
</
td
>
</
tr
>
<!-- The below enables the child repeater to see the content of objAnswers.-->
<
asp
:
repeater
runat
="server"
datasource
='
<%# DataBinder.Eval(Container.DataItem, "prpAnswers") %>
'>
<
headertemplate
>
<
table
class
="datagridSecondary"
width
="100%"
border
="1"
>
<
tr
>
<
th
align
="Left">
Answer Code
</
th
>
<
th
align
="Left">
Answer
</
th
>
</
tr
>
</
headertemplate
>
<
itemtemplate
>
<
tr
class
="datagridSecondary"
width
="100%">
<!-- The below enables the child repeater to see the content of objAnswers.-->
<
td
>
<
input
type
="checkbox"
id
="chkAnswer
<%# ((System.Collections.Generic.KeyValuePair<int,clsAnswer>)(Container.DataItem)).Value.prpDetailID %>
"
/>
</
td
>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
e.Item.FindControl("DropdownId") Returning Null
Performing secure communication to a 3'rd party site on the server side - how to?