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 176:
Line 177:        Dim pagerRow As GridViewRow = GridView1.TopPagerRow
Line 178:        Dim pageList As DropDownList = CType(pagerRow.Cells(0).FindControl("PageDropDownList1"), DropDownList)
Line 179:        Dim pageLabel As Label = CType(pagerRow.Cells(0).FindControl("CurrentPageLabel"), Label)
Line 180:        Dim RecordLabel As DropDownList = CType(pagerRow.Cells(0).FindControl("RecordDropDownList1"), DropDownList)

Source File: C:\Inetpub\vhosts\c37lg.co.uk\class37.co.uk\fleet.aspx.vb    Line: 178

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   _Default.Gridview1_DataBound(Object sender, EventArgs e) in C:\Inetpub\vhosts\c37lg.co.uk\class37.co.uk\fleet.aspx.vb:178
   System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +109
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +165
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.GridView.DataBind() +10
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +76
   System.Web.UI.Control.EnsureChildControls() +97
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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