我点击button里我如何取得checkbox的值!判断是否是选择!
我写的代码:
public void updata_sh(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
System.Web.UI.WebControls.CheckBox chk_sh;
System.Collections.ArrayList oExArgs = new System.Collections.ArrayList();
string sID; foreach(DataListItem oDataListItem in dgMain.Items)
{
if (e.Item.ItemType == ListItemType.Footer)
{
chk_sh = (CheckBox)e.Item.FindControl("chkExport");//这里应该如何写??怎么才可以取得<item>中的checkbox的值???
if(chk_sh.Checked)//这总提示没有设置对象!
{ sID = ((HtmlInputHidden)oDataListItem.FindControl("SelectedID")).Value;

oExArgs.Add(sID);
}
}
}