int i = 0;
if (((CheckBox)e.Item.FindControl("CheckBox1")).Checked)
{
i = 1;
}
if (((CheckBox)e.Item.FindControl("CheckBox1")).Checked)
{
i = 1;
}
解决方案 »
- wince手机浏览wap网页,输入登陆名密码,没有值的问题...
- 一个简单的css中div的问题
- 重新绑定后,TreeView.ExpandDepth怎么失效了?
- 在ASP.NET中如何收集网页信息??
- odp for .net 连接oracle非中文字符集的数据库时,数据为中文字符时,读写都是乱码?
- 一个关于中文字符再post的时候编码的问题!
- asp.net 的网页设计问题
- 3天内紧急求救!关于rowFilter怎样设置多个限制条件.很急
- 如何写把数据库里的3个字段并成一个字段输出?
- Type 'ADOConnection' is not defined 为什么一直这样?
- asp.net如何开始?.csproj和.vsdisco这样的扩展名,和sln的区别是什么?请高手回复,谢谢了!马上给分!
- 先混个脸熟,up有分!!!
注意,你的checkbox实在edit事件发生时才实例化的,在此之前,其实为label。
int i;
if (((CheckBox)e.Item.FindControl("Debit_Note_Grouping")).Checked) i = 1;
else
i = 0;
m_Developer.m_Debit_Note_Grouping = i.ToString();
---------运行出错误信息----------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 169: m_Developer.m_Fax_No = e.Item.Cells[7].Text;
Line 170: int i;
Line 171: if (((CheckBox)e.Item.FindControl("Debit_Note_Grouping")).Checked)
Line 172:
Line 173: i = 1;
你说得具体意思是什么,不是很明白,请给我具体说说,谢谢了。
你在什么事件中写的?