Invalid Operation Exception when I try to look at cart
Posted: Mon Jun 15, 2009 3:17 pm
I am trying to create a new website with customization by copying an old one.
I put AC demo copy on the machine. Then copied the 'Custom' folders that were created for original site because the new site we will be setting up will first be a mirror image of the production site and then get modified..
Navigating thru the products work fine. However, I cannot add to cart. (Add to cart button on the Product Page actually goes to the basket page, but in the rendering the page I get the error shown in the stack trace.
It seems that the Basket.ascx (which has NOT been modified by us) wants the product to have assets computed, but they aren't, so Product.NavigateURL is undefined. I downloaded the hot patch for 7.0.3, but this problem persists.
My questions are:
1. Have you encountered this before? (Trying to determine if our modifications to the product page caused it or if it is an AC problem.)
2. Can you offer me any clues? I've been looking at this a couple of days, and cannot see even in the 7.02 code used at the production site where that NavigateURL is set up, tho I suspect it's during the instantiation of the Basket Item. Any help would be greatly appreciated.
[InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.]
System.Web.UI.Page.GetDataItem() +2647882
System.Web.UI.TemplateControl.Eval(String expression) +31
ASP.conlib_basket_ascx.__DataBinding__control11(Object sender, EventArgs e) in c:\AC\ConLib\Basket.ascx:34
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +155
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2417
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +14
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
ConLib_Basket.BindBasketGrid() in c:\AC\ConLib\Basket.ascx.cs:55
ConLib_Basket.Page_PreRender(Object sender, EventArgs e) in c:\AC\ConLib\Basket.ascx.cs:264
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.OnPreRender(EventArgs e) +8679510
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
I put AC demo copy on the machine. Then copied the 'Custom' folders that were created for original site because the new site we will be setting up will first be a mirror image of the production site and then get modified..
Navigating thru the products work fine. However, I cannot add to cart. (Add to cart button on the Product Page actually goes to the basket page, but in the rendering the page I get the error shown in the stack trace.
It seems that the Basket.ascx (which has NOT been modified by us) wants the product to have assets computed, but they aren't, so Product.NavigateURL is undefined. I downloaded the hot patch for 7.0.3, but this problem persists.
My questions are:
1. Have you encountered this before? (Trying to determine if our modifications to the product page caused it or if it is an AC problem.)
2. Can you offer me any clues? I've been looking at this a couple of days, and cannot see even in the 7.02 code used at the production site where that NavigateURL is set up, tho I suspect it's during the instantiation of the Basket Item. Any help would be greatly appreciated.
[InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.]
System.Web.UI.Page.GetDataItem() +2647882
System.Web.UI.TemplateControl.Eval(String expression) +31
ASP.conlib_basket_ascx.__DataBinding__control11(Object sender, EventArgs e) in c:\AC\ConLib\Basket.ascx:34
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +155
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2417
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +14
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
ConLib_Basket.BindBasketGrid() in c:\AC\ConLib\Basket.ascx.cs:55
ConLib_Basket.Page_PreRender(Object sender, EventArgs e) in c:\AC\ConLib\Basket.ascx.cs:264
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.OnPreRender(EventArgs e) +8679510
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842