checking checked boxes

A

arunesh

hi all

I am writing an ASP.NET application using VB.NET as the code behin
file. I have put a repeater control on an aspx page which is filled i
from a dataset. each row of this repeater has got a checkbox which i
coded in the Item template of the repeater. In the VB.NET file of th
same page I use a for loop to go through each indivisual row of th
repeater and create a new instance of the checkbox assigning it to
variable.

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

Dim innerRepeater As CheckBox = New CheckBox
Dim lblOfficer As New TextBox


lblOfficer
CType(RptSearch.Items(i).FindControl("TextBox1"), TextBox)
innerRepeater
CType(RptSearch.Items(i).FindControl("CheckBox1"), CheckBox)

If innerRepeater.Checked Then
'delete

This for loop is in the button click event of a delete button an
inside the for loop I check if the check box is checked I then do th
delete. The delete works fine. But I now want to add a warning messag
before the delete. So in the aspx page I am writing a javascript.

function confirmDelete()
{
// loop through all elements
for (i=0; i< Form1.rptSearch.length; i++)//rptSearch is the repeate

{
// If any are checked then confirm alert, otherwise nothin
happens
if(Form1.innerRepeater.checked)
{
return confirm ('Are you sure you want to delete you
selection')
}
}
}

However this does not seem to be working. Would anyone know how can
check for the check box (if it is checked or not) and throw up
message. The message comes up as soon as the first instance of
checked checkbox is found.

Thanks
Arunes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top