在其中一個表單上發生錯誤,我可以編輯表單並單擊更新按鈕,當我第一次訪問該頁面並且一切正常時,但是如果我訪問該頁面並等待大約2 - 5分鐘,然後嘗試編輯表格並單擊更新按鈕,我出現此錯誤;'/'應用程序中的服務器錯誤
它看起來是會話ID的問題,我認爲這可能是超時問題,但我不知道。
任何建議將理解:
Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 80: protected void imgUpdateDetails_Click(object sender, EventArgs e)
Line 81: {
Line 82: SessionManager.CurrentBusinessClubMember.BCMListingDetails.BusinessClubMemberID = SessionManager.CurrentBusinessClubMember.ID;
Line 83: SessionManager.CurrentBusinessClubMember.BCMListingDetails.Address1 = editaddressline1.Value;
Line 84: SessionManager.CurrentBusinessClubMember.BCMListingDetails.Address2 = editaddressline2.Value;Source File: d:Sitesdemelzabusinessclub.co.ukpublic_htmlWebsiteListingDetails.aspx.cs Line: 82
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] DemelzaBusinessClubSite_ListingDetails.imgUpdateDetails_Click(Object sender, EventArgs e) in d:Sitesdemelzabusin/essclub.co.ukpublic_htmlWebsiteListingDetails.aspx.cs:82
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565Version Information: Microsoft .NET
Framework Version:2.0.50727.5444;
ASP.NET Version:2.0.50727.5420
調試您的代碼並查看會話ID的值。另外,如果你可以避免使用Session,請這樣做。 – ZippyV 2011-05-18 09:32:28