i am using image button and link button in list view and binding data in onload method.oncommand for image button is working fine but oncommand for link button is not firing here is code of list view:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ListView runat="server" ID="List1" >
<ItemTemplate>
<table>
<tr>
<td>
<asp:ImageButton runat="server" ID="imagebutton" ImageUrl='<%# Eval("image") %>' CommandArgument='<%# Eval("id") %>' CommandName="button" Width="100px" Height="100px" OnCommand="imagebutton_Command" ></asp:ImageButton>
</td>
<td>
<asp:LinkButton ID="title" runat="server" Text='<%# Eval("title") %>' CommandArgument='<%# Eval("id") %>' CommandName="link" OnCommand="imagebutton_Command"></asp:LinkButton></td>
</tr>
</table>
</ItemTemplate>
</asp:ListView>
</asp:Content>
and code for oncommad event is:
protected void imagebutton_Command(object sender, CommandEventArgs e)
{
try
{
Response.Redirect("Welcome.aspx?url=" + e.CommandArgument.ToString());
}
catch (Exception ex)
{
ex.ToString();
}
}
I also tried break point on oncommand method but when i click on image button it works fine but when i click on link button it does not fired and does not come in oncommad block