Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 

[NullReferenceException: Object reference not set to an instance of an object.]
NopSolutions.NopCommerce.Web.Templates.Categories.ProductsInGrid.dlSubCategories_ItemDataBound(Object sender, DataListItemEventArgs e) +1052
System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) +8823282
System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +152
System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +488
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +64
System.Web.UI.WebControls.BaseDataList.DataBind() +55
NopSolutions.NopCommerce.Web.Templates.Categories.ProductsInGrid.BindData() +2165
NopSolutions.NopCommerce.Web.Templates.Categories.ProductsInGrid.Page_Load(Object sender, EventArgs e) +93
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Posted 2-Oct-12 20:33pm
Comments
Member 9410081 at 3-Oct-12 2:33am
   
can any1 help me out resolving this error??
AshishChaudha at 3-Oct-12 4:48am
   
When you are getting this error...How do we know that what you have written in your code and where you are getting this Exception...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

That should be relatively easy to diagnose, step into the app from the point at which your request hits your code and you will fail on the line that is causing the trouble.
 
The error means you are trying to make use of an object before it exists. e.g.
SomeObject o; 
o = 4;
would fail, but;
SomeObject o = new SomeObject();
o = 4;
is ok.
 
You can also get these errors if a function fails to return an object for which you were expecting one. Looking at the stack above it is possible the databound list has no data object to bind to.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Nirav Prabtani 298
1 OriginalGriff 289
2 Sergey Alexandrovich Kryukov 225
3 _Amy 165
4 Richard MacCutchan 135
0 OriginalGriff 7,799
1 Sergey Alexandrovich Kryukov 6,966
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100