Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:58:45+00:00 2026-05-25T11:58:45+00:00

I have a shopping cart ListView control backed by a custom object that has

  • 0

I have a shopping cart ListView control backed by a custom object that has methods for selecting and deleting. In the ListView, one of the columns is an ImageButton that is essentially a delete icon, with the CommandName parameter set to CommandName="Delete".

My issue is related to updating the shopping cart ListView on delete; as the delete method is stored in the custom business entity object, I am having trouble in terms of updating the calculations made inside the cart (we have deleted an item, so I need to recalc shipping, taxes, etc).

Right now, I have the cart ListView control calling it’s calculate method in page load on Not Page.IsPostBack, but obviously this isn’t triggered by the delete method.

Any recommendations on where to handle calling the calculate method on deletion when deletion is happening outside of the scope of the control in my custom business logic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:58:45+00:00Added an answer on May 25, 2026 at 11:58 am

    Consider binding your recalculation method to your ListView‘s ItemDeleted Event. For instance:

    Sub ShoppingCartListView_ItemDeleted(sender As Object, e As ListViewDeletedEventArgs) Handles ShoppingCartListView.ItemDeleted
    
        ' Determine whether an exception occurred
        If e.Exception Is Nothing Then
            ' Ensure that a record was deleted.
            If e.AffectedRows > 0 Then
                ' Call recalculation method
                CalculateCharges()
            End If
        Else
            ' Handle e.Exception
            HandleMyException(e.Exception)
        End If
    End Sub
    

    Honestly, the error checking for AffectedRows might be a bit extraneous for your use case, but it never hurts to know what information is available to you in the ListViewDeletedEventArgs.

    EDIT:

    If you need to add support to your business logic for information regarding the number of rows affected by the transaction, ensure first that the method called by the ObjectDataSource.DeleteMethod property has a return value that is either an integer or has a property or function that will return one. Next, add a handler to your ObjectDataSource.Deleted event. Here, you can assign the return value from the method that is contained in the event arguments to another event argument member similarly called AffectedRows. For instance:

    Sub BusinessObjectDataSource_Deleted(sender as Object, e As ObjectDataSourceStatusEventArgs) Handles BusinessObjectDataSource.Deleted
        e.AffectedRows = CInt(e.ReturnValue)
    End Sub
    

    Since e.ReturnValue is passed in as an Object, you can cast it as needed and access any particular property that has the information required to update e.AffectedRows.

    The value provided to these arguments will be passed on to your ListView.ItemDeleted event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shopping cart page (Cart.aspx) that has a button that will (sometimes)
I have a Transactions object (as a part of a shopping cart) that belongs_to
I have a shopping cart that continually logs slow queries like this one... #
I have a shopping cart script that I am trying to modify to support
I have a shopping cart system in Cakephp, this table has all your usual
I have a shopping cart that displays product options in a dropdown menu and
I have shopping cart web application. when I am running that in my local
I have a shopping cart array, which has a variable to tell me if
I have a shopping Cart that contains many cart item and price or the
I have a shopping cart which at this point in time sends items that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.