By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

asp:button problems

P: n/a
Hi everyone,

I have the following shopping cart (basket view). However, Delete button in
my datagrid doesn't fire any events. Does anyone know why? (It's a user web
control)

<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="ShoppingCart.ascx.cs" Inherits="TPShoppingCart.ShoppingCart1"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:datagrid id="DGShoppingCart" AutoGenerateColumns="False" Width="650"
runat="server">
<Columns>
<asp:BoundColumn DataField="ProductID" HeaderText="Product ID"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>
<asp:BoundColumn DataField="ProductName" HeaderText="Product"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>
<asp:BoundColumn DataField="Price" HeaderText="Price"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
DataFormatString="{0:c}" ItemStyle-CssClass="normtext"></asp:BoundColumn>
<asp:BoundColumn DataField="Qty" HeaderText="Quantity"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>
<asp:ButtonColumn ButtonType="PushButton" CommandName="Delete"
Text="Delete"></asp:ButtonColumn>
</Columns>
</asp:datagrid>
<P>&nbsp;</P>
<P class="normtext" align="center"><b>Total:</b>
<asp:label id="lblCurrencySign" runat="server"
CssClass="normtext">$</asp:label><asp:label id="lbTotalAmount"
runat="server" CssClass="normtext" Font-Bold="False">
Label</asp:label></P>
<P align="center"><asp:button id="BtnContinue" runat="server"
CssClass="button1" Text="Continue Shopping"></asp:button>&nbsp;
<asp:button id="BtnCheckout" runat="server" CssClass="button2"
Text="Checkout"></asp:button></P>

As a test I have,

private void DGShoppingCart_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
Response.Redirect("http://www.google.com");
}

It's doesn't even get to the event.

Any suggestions?

Thank you
Maz.
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.