Ok, here's a quick sample:
this is a snippet out of the aspx page:
<table>
<asp:Repeater runat="server" ID="myRepeater">
<ItemTemplate>
<tr>
<td>
<asp:CheckBox runat="server" ID="myCheckBox" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<asp:Button ID="doPostBack" runat="server" Text="Do PostBack" />
in the code, I show how to bind the checkboxes and then access whatever
their values are on postback:
Protected Sub myRepeater_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
myRepeater.ItemDataBound
If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem) Then
Dim myCheckBox As CheckBox =
CType(e.Item.FindControl("myCheckBox"), CheckBox)
myCheckBox.Checked = CBool(e.Item.DataItem)
End If
End Sub
Public Overrides Sub DataBind()
Dim checkBoxValues(2) As Boolean
checkBoxValues(0) = True
checkBoxValues(1) = False
checkBoxValues(2) = True
myRepeater.DataSource = checkBoxValues
MyBase.DataBind()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If (Not IsPostBack) Then
DataBind()
End If
End Sub
Protected Sub doPostBack_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles doPostBack.Click
Dim index As Integer
While (index < myRepeater.Items.Count)
Dim myCheckBox As CheckBox =
CType(myRepeater.Items(index).FindControl("myCheckBox"), CheckBox)
Dim output As LiteralControl = New
LiteralControl(String.Format("Item index: {0}; CheckBox Checked:
{1};<br>", index, myCheckBox.Checked.ToString()))
Page.Controls.Add(output)
index += 1
End While
End Sub