//This is my button on the .ascx file
<asp:LinkButton runat="server" ID="btnProductDelete" CssClass="buttons btn_style3 left shopping-cart-delete">
<div>
<span><asp:Literal runat="server"> X </asp:Literal></span>
</div>
</asp:LinkButton>
//On the .cs file inside the lvCart_ItemDataBound function I added this:
var btnProductDelete = dataItem.FindControl("btnProductDelete") as LinkButton;
if (btnProductDelete != null)
{
btnProductDelete.Command += new CommandEventHandler (lvCart_ItemDeleteCommand);
}
//Then I added the call back function named lvCart_ItemDeleteCommand
protected void lvCart_ItemDeleteCommand(object sender, CommandEventArgs e)
{
this.DisplayAlertMessage(GetLocaleResourceString("Products.ProductHasBeenAddedToTheCart"));
}
I added the alert message to validate that it is in fact working. But I cannot get this function to be called. I have tried dozens of different things. If there is anyone that can give me some direction as to getting my button to delete an item from the mini cart I would be very greatful. Or this function to get called with any of the items in the cart.
Thanks,
Brennan