这是页面代码
<asp:Button ID="btnChoice" runat="server" Text="全选" Width="63px" OnClick="btnChoice_Click" />
<asp:Button ID="btnDeal" runat="server" Text="处理" Width="63px" OnClick="btnDeal_Click" ></asp:Button >
这是按钮btnDeal 的事件
protected void btnDeal_Click(object sender, EventArgs e)
{
if (this.btnDeal.Text == "处理")
{
foreach (DataListItem dli in this.dlLodgeInfo.Items)
{
Boolean str = ((CheckBox)dli.FindControl("selecte")).Checked;
if (str == true)
{
string str2 = ((Label)dli.FindControl("TitleID")).Text;
if (info.DealWith(str2) == true)
{
Response.Write("<script language='javascript'>alert('处理成功!!!')</script>");
}
else
{
Response.Write("<script language='javascript'>alert('处理失败!!!')</script>");
}
}
}
}
}
我的要求是在Boolean str = ((CheckBox)dli.FindControl("selecte")).Checked;
获取得到str=true 但是在这得到的是false 请问这需要做怎么的改进