The error occurs on one of the forms, I can edit the form and click the update button when I first go to the page and everything works fine, but if I visit the page and wait for about 2 -5 minutes and then try editing the form and clicking the update button I ge this error;
It looks to be something wrong with the session ID and I thought it could be something to do with timeout issues but im not sure.
Any suggestions will be appreciated:
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: 82Stack 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
in your method
you have a line that states
The error indicates that one of the following hasn’t been instantiated before being used.
unless you are storing these objects somewhere like in the session and pulling them out on each post back they will be null!