你调用的对象是空的.? [英] Object reference not set to an instance of an object.?

查看:106
本文介绍了你调用的对象是空的.?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此行中遇到错误..有人可以告诉我可以解决此错误的错误类型吗?.am在我的项目中使用dynamic.

hi am getting error in this line..can anyone tell me wat type of error that i can solve this..?am using dynamic in my project.

protected void Page_Init(object sender, EventArgs e)
    {
      objDyn.GenerateTabControls("FM_FactoryMaster", out dynDiv, out gListDynamicControls, true, false, false);

}


感谢

推荐答案

看看此处 [ ^ ]


此当您尝试使用属性或调用对象的方法为null时,会发生错误.更多详细信息:此处 [
This error happens when you try to use a property or call a method of an object that is null. More details: here[^]

A simple use of Visual studio DEBUGGER can tell you the object because of which it is happening. Just look at the stack trace and put a debugger on that line. Check the objects of that line and see if any one is null and you are trying to use that objects property. Handle the same.

Above, looks like objDyn is NULL or one of the parameters passed assuming error is not raised in GenerateTabControls method.


在page_load上将此代码写入page_init
write this code on page_load in place page_init


这篇关于你调用的对象是空的.?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆