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 884:
Line 885:            SitePagesEntity NewsEntity = SitePages.GetByID(Convert.ToInt32(IDRecord), false, PortalSiteName, PortalLanguage);
Line 886:            int IDCategory = NewsEntity.IDCategory;
Line 887:            string Title = NewsEntity.Title;
Line 888:

Source File: d:\WebSites\RashinWeb\_Gadgets\General\SiteCurrentLocation.ascx.cs    Line: 886

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   _ascx_General_CurrentLoc.CheckingSitePagesPath(String RequestURL, String RequestRaw, ArrayList& Location_URL, ArrayList& Location_Title) in d:\WebSites\RashinWeb\_Gadgets\General\SiteCurrentLocation.ascx.cs:886
   _ascx_General_CurrentLoc.GetPathList() in d:\WebSites\RashinWeb\_Gadgets\General\SiteCurrentLocation.ascx.cs:80
   _ascx_General_CurrentLoc..ctor(Int32 GadgetLoadedID) in d:\WebSites\RashinWeb\_Gadgets\General\SiteCurrentLocation.ascx.cs:43

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +365
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +34
   BusinessLayer.PortalBaseUserControl.LoadControl(String UserControlPath, Object[] constructorParameters) in d:\WebSites\RashinWeb\App_Code\_PortalBaseClasses\PortalBaseUserControls.cs:111
   BusinessLayer.Site_MasterPages.GenerateCodesInTemplate(PortalBaseUserControl CurrentControl, String& HTMLPage, String SiteName, Int32 EmamzadehID, Languages Language) in d:\WebSites\RashinWeb\App_Code\PagesClasses\MasterPage\Site_MasterPages_Business.cs:113
   _Gadgets_General_MultiPerpouse_Data..ctor(Int32 GadgetLoadedID) in d:\WebSites\RashinWeb\_Gadgets\General\MultiPerpouse_Data.ascx.cs:95

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +365
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +34
   BusinessLayer.PortalBaseUserControl.LoadControl(String UserControlPath, Object[] constructorParameters) in d:\WebSites\RashinWeb\App_Code\_PortalBaseClasses\PortalBaseUserControls.cs:111
   _ascx_Layouts_Model_2..ctor(Site_LayoutInModulesEntity _Site_LayoutInModulesEntity, Page _WebPage, String ModuleName, String ModulePage) in d:\WebSites\RashinWeb\_ascx\Layouts\3.ascx.cs:259

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +365
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +34
   BusinessLayer.PortalUserPage.LoadControl(String UserControlPath, Object[] constructorParameters) in d:\WebSites\RashinWeb\App_Code\_PortalBaseClasses\PortalUserPage.cs:36
   News_Show.Page_Load(Object sender, EventArgs e) in d:\WebSites\RashinWeb\SitePages\Show.aspx.cs:24
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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