Mass Approve using a Checkbox

a8le

Well-known member
Joined
Oct 27, 2005
Messages
75
Programming Experience
5-10
Hi all,

I am trying to write a mass approve script for my site, similar to deleting all unwanted email using: a repeater (not a datagrid), a checkbox in each indexItem, and a button.

Psuedo/Logic:
1) Load Repeater with list of "UNmoderated" items
2) Put a checkbox inside the repeaters ItemTemplate
3) Add code to button (dosomething if checkbox is check)

Problem:
I can't locate the column (no columns in repeater, i know) with the PrimaryUniqueID... my Stored Procedure requires the PrimaryUniqueID.

Button code:
VB.NET:
Private Sub MassApprove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MassApprove.Click
Try
	Dim MyRptItem As RepeaterItem
	For Each MyRptItem In MyRepeater.Items
		Dim chbxMassApprove As CheckBox = CType(MyRptItem.FindControl("chbxMassApprove"), CheckBox)
		[COLOR="Red"]Dim PrimaryUniqueID As String = MyRptItem.DataItem(PrimaryUniqueID)[/COLOR]
		If chbxMassApprove.Checked = True Then
			'DO THE MASS APPROVE
			'LOOP THRU STORED PROCEDURE
		End If
	Next
Catch exc As Exception
	Response.Write(exc.ToString)
End Try
End Sub

As you can see, my problem is the line in red. I have tried everything I could think of... please help. Thanks in advance. Oh, I am programming using asp.net v1.

-Thuan
 
Well, I gave in and used this as a workaround if this helps anyone...

Front End:
VB.NET:
Text='<%# DataBinder.Eval(Container, "DataItem.PrimaryUniqueID") %>'

Back End:
VB.NET:
Dim PrimaryUniqueID As String = ckbxMassApprove.Text.ToString

-Thuan
 
Last edited:
Back
Top