.aspx
function GoChecktwo(ItemCount)
{
var iCount = 0;
for(var i=0;i<ItemCount;i++)
{
var chk = document.getElementById("RBLDrink_Cate_"+i);
if(chk!=null )
{
if(chk.checked)
iCount ++;
}
}
if(iCount >=3)
{
alert("最多选择两个");
return false;
}
}
.cs
this.RBLDrink_Cate.Attributes.Add("onclick", "javascript:return GoChecktwo(" + this.RBLDrink_Cate.Items.Count + ");");