62,073
社区成员
发帖
与我相关
我的任务
分享
public void chos (RepeaterItemEventArgs e)
{
//string[] person ={ };
ArrayList arr = new ArrayList();//定义数组,存放员工工号
CheckBoxList ck = e.Item.FindControl("ch_renyuan") as CheckBoxList;//从repter中获得checkboxList的ID
for (int i=0; i < ck.Items.Count; i++)//循环获得checkboxlist被选中的值
{
if (ck.Items.Count > 0)//判断是否有选择
{
if (ck.Items[i].Selected == true)//判断哪个被选择
{
// person += ck.Items[i].Value.ToString();
arr.Add(ck.Items[i].Value);
}
}
else
{
Response.Write("<script>alert('请选择收件人!!')</script>");
}
}
protected void rptQuestionList_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "toDetail")
{
int itemIndex = e.Item.ItemIndex;
this.hfldRepIndex.Value = itemIndex.ToString();
}
}
protected void btn_chok_Click(object sender, EventArgs e)
{
ArrayList arr = new ArrayList();//定义数组,存放员工工号
foreach (RepeaterItem item in rpbumen.Items)
{
CheckBoxList ck = item.FindControl("ch_renyuan") as CheckBoxList;
for (int i = 0; i < ck.Items.Count; i++)
{
if (ck.Items[i].Selected)
{
arr.Add(ck.Items[i].Value);
Response.Write("<script>alert('" + arr + "')</script>");
}
}
}
}
protected void btn_chok_Click(object sender, EventArgs e)
{
}