Hello All 

I am trying to use checkbox in asp repeater ...here i ahve given the code 
can anyone tell em ...what is wrong with that?

***************************************

<asp:repeater id="rptCursus" runat="server" enableviewstate="False">
<HeaderTemplate>
<table class="table" align="left">
<tr style="background-color:black;color:white;font-weight:400;">
<td>Cursus ID</td>
<td>Titel</td>
<td>Basisduur</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox Enabled="True" Checked="False" ID="Checkbox1" EnableViewState="true" 
Runat=server Text='<%# container.dataitem("cursusID")%>'>
</asp:CheckBox></td>
<td><a href='<%# String.format("CursusDetails.aspx?id={0}", 
container.dataitem("cursusID"))%>' target="_blank"><%# 
container.dataitem("titel")%></a></td>
<td><%# container.dataitem("basisduur")%></td>
</tr>
</ItemTemplate>

<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>


My code behinde


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
Handles Button1.Click

Dim i As Integer

For i = 0 To rptCursus.Items.Count - 1

Dim CurrentCheckBox As CheckBox = CType(rptCursus.Items(i).FindControl("Checkbox1"), 
WebControls.CheckBox)

 

 

If CurrentCheckBox.Checked Then

Response.Redirect("Main.aspx")
Else
lblError.Text = "no"

End If

Next

End Sub 



Regards

Arindam



Yahoo! India Matrimony: Find your partner online.

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to