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 421:                Dim DistName As String = DR1("DISTRICT_NAME").ToString().Replace("/", " ").Replace("&", " ").CollapseSpaces().Trim()
Line 422:                Dim EstaName As String = DR1("ESTATE_NAME").ToString().Replace("/", " ").Replace("&", " ").CollapseSpaces().Trim()
Line 423:                Dim AgentImage As String = "/Upload/" & GlobalVar.sTAFFs.Where(Function(x) x.DISABLED = "N" And x.AGENT = "Y").FirstOrDefault(Function(x) x.EnglishName.Equals(StaffMapping(Convert.ToInt32(DR1("PROPERTY_ID"))))).PHOTO_PATH
Line 424:                Dim sendby As String = "?sentby=" & GlobalVar.sTAFFs.Where(Function(x) x.DISABLED = "N" And x.AGENT = "Y").FirstOrDefault(Function(x) x.EnglishName.Equals(StaffMapping(Convert.ToInt32(DR1("PROPERTY_ID"))))).TOKEN
Line 425:            %>

Source File: Z:\Sources\Website\WebApplication\Rental-Selection-Nov.aspx    Line: 423

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ASP.rental_selection_nov_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in Z:\Sources\Website\WebApplication\Rental-Selection-Nov.aspx:423
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +116
   System.Web.UI.Page.Render(HtmlTextWriter writer) +38
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +9479


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