当前位置:编程学习 > C#/ASP.NET >>

未将对象引用设置到对象的实例

未将对象引用设置到对象的实例。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误: 


行 78:  // Set the initial zoom, center and size of the map
行 79:  // This step is needed because you may get a dirty map from mapinfo Session.Current which is retrived from session pool.
行 80:  myMap.Zoom = new MapInfo.Geometry.Distance(2500, DistanceUnit.Mile);
行 81:  myMap.Center = new DPoint(27775.805792979896,-147481.33999999985);
行 82:  myMap.Size = new System.Drawing.Size((int)this.MapControl1.Width.Value, (int)this.MapControl1.Height.Value);
 

源文件: c:\Documents and Settings\briup\桌面\Web\Features\Find\FindCS\WebForm1.aspx.cs    行: 80 

堆栈跟踪: 


[NullReferenceException: 未将对象引用设置到对象的实例。]
   FindSampleWeb.WebForm1.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\briup\桌面\Web\Features\Find\FindCS\WebForm1.aspx.cs:80
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
   System.Web.UI.Control.OnLoad(EventArgs e) +80
   System.Web.UI.Control.LoadRecursive() +49
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745

因为换了更复杂的地图,就出现这样的错误了。大家帮我看看,到底怎么改程序呢?

 
--------------------编程问答-------------------- 对象为null
没有将对象实例化
设置断点调试一下 --------------------编程问答-------------------- 对象没有实例化 --------------------编程问答-------------------- 对象没有实例化
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,