Product Grid Question

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
How do i remove the Add to Cart, and Product description from the Product Grid view page?

I comment out the add to cart button in the .cs file, i then delete the button and i get...

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.Modules.ProductBox1Control.BindData() +926
   NopSolutions.NopCommerce.Web.Modules.ProductBox1Control.DataBind() +39
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +137
   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() +2081
   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



Can anyone tell me what i am doing wrong please? btw, im using version 1.80
13 years ago
Could you specify what you removed? Filename and a couple of lines if code.

I’m pretty sure that I know what went wrong but it would be great to see the code before I answer you so I don’t mess anything up for you.
13 years ago
It's on the productbox1.aspx page i do belive.

Basically i wanted to remove the  short text, and the add to cart button :)

hope that helps
13 years ago
Remove all references to lShortDescription and btnAddToCart. Both in the .cs and the .ascx file.
13 years ago
yeah, i did that. Well i commented them out just incase i wanted them later. but it comes up with the NULL error i posted above
13 years ago
Did you recompile/rebuild the project after you changed the .cs code?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.