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 20: 
Line 21:             var pd = db.NetshellPage_Level1.FirstOrDefault(s => s.NetshellPage_Level1Id == pid);
Line 22:             if (pd.AssociationID != null)
Line 23:             {
Line 24:                 var asid = db.NetshellAssociation.FirstOrDefault(s => s.NetshellAssociationId == pd.AssociationID);

Source File: c:\inetpub\vhosts\gmcs.ac.in\gmcs.edu.in\DetailedView.aspx.cs    Line: 22

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   DetailedView.Page_PreInit(Object sender, EventArgs e) in c:\inetpub\vhosts\gmcs.ac.in\gmcs.edu.in\DetailedView.aspx.cs:22
   System.Web.UI.Page.OnPreInit(EventArgs e) +11691639
   System.Web.UI.Page.PerformPreInit() +46
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +334


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0