Error on Basket Page

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
webmaz
Lieutenant (LT)
Lieutenant (LT)
Posts: 52
Joined: Wed Apr 14, 2010 3:57 pm

Error on Basket Page

Post by webmaz » Wed Oct 08, 2014 10:52 am

I noticed an error in my error logs related to the basket page. It seems like it could be easy to fix, but I'm new to C#.
Any insights?

An error has occured at http://www.website.com/Basket.aspx
Exception: Exception of type 'System.Web.HttpUnhandledException' was thrown. Stack Trace: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.basket_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Inner Exception: An error has occurred because a control with id 'ctl00$ctl00$NestedMaster$PageContent$CheckoutButton' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error. Inner Exception Stack Trace: at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Error on Basket Page

Post by Katie » Wed Oct 08, 2014 1:30 pm

An error has occurred because a control with id 'ctl00$ctl00$NestedMaster$PageContent$CheckoutButton' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.
Have you made any customizations to this page?
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

webmaz
Lieutenant (LT)
Lieutenant (LT)
Posts: 52
Joined: Wed Apr 14, 2010 3:57 pm

Re: Error on Basket Page

Post by webmaz » Wed Oct 08, 2014 1:54 pm

There is second checkout button.

Partial code is below.

Designer:

Code: Select all

<asp:LinkButton ID="CheckoutButtonNew" runat="server" OnClick="CheckoutButton_Click" Text="Checkout >>" EnableViewState="false" CssClass="checkoutbutton"></asp:LinkButton>
...
<asp:LinkButton ID="CheckoutButton" runat="server" OnClick="CheckoutButton_Click" Text="Checkout >>" EnableViewState="false" CssClass="checkoutbutton"></asp:LinkButton>
Code Behind:

Code: Select all

        protected void BasketGrid_DataBound(object sender, EventArgs e)
        {
            if (BasketGrid.Rows.Count > 0)
            {
                CheckoutButton.Visible = !AbleContext.Current.Store.Settings.ProductPurchasingDisabled;
				CheckoutButtonNew.Visible = !AbleContext.Current.Store.Settings.ProductPurchasingDisabled;
                ClearBasketButton.Visible = true;
                UpdateButton.Visible = true;
                EmptyBasketPanel.Visible = false;
                ValidateOrderMinMaxAmounts();
            }
            else
            {
                CheckoutButton.Visible = false;
				CheckoutButtonNew.Visible = false;
                ClearBasketButton.Visible = false;
                UpdateButton.Visible = false;
                OrderAboveMaximumAmountMessage.Visible = false;
                OrderBelowMinimumAmountMessage.Visible = false;
                EmptyBasketPanel.Visible = true;
            }
        }

Post Reply