TrialUser
asked on
Triggerring ItemCommand to trigger a button click inside a Datalist
I have a datalist contorl inside which I have a button. I want to trigger the button click and do some server side code. I have the following code in the seerver side and client side. But I am not able to trigger this event at all. Please help. Am I using the right event to trigger the button click or should I use a diff. one. Please help thanks
Private Sub dlProduct_ItemCommand(ByVa l source As Object, ByVal e As System.Web.UI.WebControls. DataListCo mmandEvent Args) Handles dlProduct.ItemCommand
If e.CommandName = "AddCart" Then
'some code
End Sub
<asp:DataList ID="dlProduct" runat="server" OnItemCommand ="dlProduct_ItemCommand">
<ItemStyle Font-Bold="True" />
<ItemTemplate>
<asp:ImageButton ID="imgTopAddtoCart" runat="server" ImageAlign="Right" ImageUrl="/Assets/Images/P roducts/Ad dtoCart.jp g" CommandName="AddCart" CommandArgument='<%# DataBinder.Eval(Container. DataItem, "ItemID")%>' />
Private Sub dlProduct_ItemCommand(ByVa
If e.CommandName = "AddCart" Then
'some code
End Sub
<asp:DataList ID="dlProduct" runat="server" OnItemCommand ="dlProduct_ItemCommand">
<ItemStyle Font-Bold="True" />
<ItemTemplate>
<asp:ImageButton ID="imgTopAddtoCart" runat="server" ImageAlign="Right" ImageUrl="/Assets/Images/P
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Programmatically? From client side or server side?