protected void btnSelect_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Request.Params["checkboxId"]))
{
string idList = Request.Params["checkboxId"]; // checkboxId 是 HTML元素的name属性.如果有多个相同名字的 checkboxId,则得到的是以逗号分割的字符串.(Y)
string[] strList = idList.Split(',');
int ListCount = strList.Length;
if (ListCount == 2)
{
txtObjectType.Value = strList[1];
hidCompanyUserId.Value = strList[0];
}
else
{
MessageBox.Show(this.UpdatePanel1, "只能选择一项");
return;
}
}
}