Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code is as follows-

<asp:ListView ID="productList" runat="server" DataKeyNames="ProductID" GroupItemCount="4" ItemType="BiggMart.Models.Product" SelectMethod="GetProducts" OnItemCommand="productList_ItemCommand">
XML
<ItemTemplate>
                   <td runat="server">
                       <ul>
                        <li class="first">

XML
<asp:Button runat="server" text= "Add" CssClass="button" OnClick="Unnamed_Click">
 </asp:Button>






I want to access this button click event in code behind. How can I do it?
Posted

1 solution

Just code following in code file:
C#
protected void Unnamed_Click(object sender, EventArgs e)
{
 //Your Code
}

You can bind CommandArgument property of button and use it in code.
 
Share this answer
 
Comments
Sanchita Podder 16-Aug-14 8:29am    
Tried the solution...but no luck.
Vinay Mistry 18-Aug-14 0:54am    
what do you want to do? please clarify your query in detail. If you want click event of button then above given solution will work in your app.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900