Copy Code code as follows:
public static void Prerepater (Repeater repeater,system.web.ui.page Page)
{
ClientScriptManager cs = page. ClientScript;
for (int i = 0; i < repeater. Items.Count; i++)
{
CheckBox CBX = (checkbox) repeater. Items[i]. FindControl ("Cbxid");
Register the ClientID of the corresponding server control to the client JavaScript array
Cs. Registerarraydeclaration ("Cbxarray", String.Concat) ("'", CBX. ClientID, "'"));
}
}
JS determines whether to select and eject the warning window:
Copy Code code as follows:
Determines whether the method that is bound from the background is selected
function Delit ()
{
var cbxbool = 0;
for (var i = 0;i < cbxarray.length;i++) {
var obj = $ (cbxarray[i]);
if (obj.checked = = True) {
Cbxbool = 1;
Break
}
}
if (Cbxbool = = 1) {
var result = confirm (delete unrecoverable, determine the current operation?) ");
if (result) {
return true;
}
}else{
Alert ("You have not selected");
return false;
}
return false;
}