我随机收到此错误,并想知道调试此错误的最佳方法及其含义。
MESSAGE: Object reference not set to an instance of an object.
SOURCE: POL
FORM: __VIEWSTATE={{LONG STRING OF TEXT HERE}}
URL: /SourceIt.aspx
QUERYSTRING:
TARGETSITE: Void Page_Load(System.Object, System.EventArgs)
STACKTRACE: at POL.PreDischargeEducation.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
编辑:这个错误也随机发生。更新 .NET 或服务器端的东西可能是造成这种情况的原因吗?
编辑:
protected void Page_Load( object sender, EventArgs e ) {
ctlBriefingAffidavitSpouse.Filer = "J";
ErrorTR.Visible = false;
lblErrorMessage.Visible = false;
ErrorTRBottom.Visible = false;
lblErrorMessageBottom.Visible = false;
if (!IsPostBack) {
CheckCheckmarks();
ctlBriefingOverview.Visible = true;
} else {
string ctrlname = Request.Params.Get( "__EVENTTARGET" );
if(ctrlname.Length <= 0)
ShowNextControl();
}
}
编辑:这段代码也不是我的。我正在尝试调试它为什么会随机损坏。我注意到在执行此特定操作时,99% 的时间似乎是 IE 的问题。