日期:2014-05-18  浏览次数:20427 次

【加急!】未将对象引用设置到对象的实例(网站发布后,源码浏览没有问题)
未将对象引用设置到对象的实例。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

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

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

堆栈跟踪: 


[NullReferenceException: 未将对象引用设置到对象的实例。]
  CuteEditor.Impl.b..ctor(Type type, String key) +74
  CuteEditor.a.i(HtmlTextWriter A_0) +147
  CuteEditor.Editor.Render(HtmlTextWriter writer) +46
  System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
  System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
  System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
  System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
  System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
  System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
  System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
  System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
  System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
  System.Web.UI.Page.Render(HtmlTextWriter writer) +29
  System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
  System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

 


--------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.4927; ASP.NET 版本:2.0.50727.4927

------解决方案--------------------


看错误应该是用的第三方控件缺少引用。。。
------解决方案--------------------


把第三方控件的DLL放到网站目录下。。再引用。。。。
------解决方案--------------------
string userName = Convert.ToString(Session["userName"]);
这句在session过期/丢失时就会抛异常
------解决方案--------------------
C# code
string userName = "";
if(Session["userName"] != null)
   userName = Session["userName"].ToString();