473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

asp:button problems

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
0 1552

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RSB | last post by:
Hi Every one, Having tuff time to make this work .. i want to have a button and on my form say Delete button. So once i click on it i want to confirm "Are you sure?" on the Client Side and if...
11
by: Frag | last post by:
Hi guys, I searched around without any clear answer. Tons of stuff, but nothing concrete. I am trying to call this Javascript function: function ButtonClicked() { alert("The button has...
4
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: hb | last post by:
Hi, When I add an asp:button (ex: id=btnLog) on home.aspx, I need to create btnLog_Click() event in home.aspx.cs, and also link this event and the button in OnInit() method by adding:...
1
by: RUIZCJ | last post by:
Hi, I'm at my wits end!!! I have the following code. The submit button works on my home computer but when I copy the dll and the ASPX file to my host provider, the button does NOT fire. TIA...
8
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
0
by: Maziar Aflatoun | last post by:
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...
4
by: Sean | last post by:
I have a situation whereby I need to modify the text string appearing on an ASP button with some text derived from a Javascript function. But I am unsure of the correct syntax to do so. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.