System.NullReferenceException

Object reference not set to an instance of an object.

Exception source: System.Web

Exception string:

System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.UI.WebControls.PagedDataSource.GetEnumerator() at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at Controls_Portals_2_usercontrols_gallery_gallery.loadGallery(String t, String id) in D:\Websites\Caracole\Staging\Portal\controls\portals\2\usercontrols\gallery\gallery.ascx.vb:line 280 at Controls_Portals_2_usercontrols_gallery_gallery.Page_Load(Object sender, EventArgs e) in D:\Websites\Caracole\Staging\Portal\controls\portals\2\usercontrols\gallery\gallery.ascx.vb:line 33 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Object reference not set to an instance of an object.

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 278:            Me.pnlPage.Visible = False
Line 279:            Me.dlGallery.DataSource = objPds
Line 280:            Me.dlGallery.DataBind()
Line 281:            Me.pnlAll.Visible = True
Line 282:            imgViewAll.Visible = False

Source File: D:\Websites\Caracole\Staging\Portal\controls\portals\2\usercontrols\gallery\gallery.ascx.vb    Line: 280

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.UI.WebControls.PagedDataSource.GetEnumerator() +394
   System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +720
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +87
   Controls_Portals_2_usercontrols_gallery_gallery.loadGallery(String t, String id) in D:\Websites\Caracole\Staging\Portal\controls\portals\2\usercontrols\gallery\gallery.ascx.vb:280
   Controls_Portals_2_usercontrols_gallery_gallery.Page_Load(Object sender, EventArgs e) in D:\Websites\Caracole\Staging\Portal\controls\portals\2\usercontrols\gallery\gallery.ascx.vb:33
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Control.LoadRecursive() +164
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3320