24
在我的asp.net program.I设置一个保护list.And我在list.But添加值就说明不设置到对象错误如何解决未将对象引用设置为对象的实例?
protected List<string> list;
protected void Page_Load(object sender, EventArgs e)
{
list.Add("hai");
}
如何解决这个错误的实例对象引用?
几乎所有的'NullReferenceException'都是一样的。请参阅“[什么是.NET一个NullReferenceException?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net)”获得一些提示。 –