I have a user control where I am using an Accordion control having the kind of structure as follows. I have a linkbutton control in the HeaderTemplate.
<asp:Accordion ID="Accordion1" runat="server" AutoSize="Fill" Width="800px"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
RequireOpenedPane="false"
SuppressHeaderPostbacks="true"
HeaderCssClass="accordionHeader"
ContentCssClass="accordionContent">
<HeaderTemplate>
<asp:LinkButton ID="txtArtist" CommandName="Select" Width="100%" runat="server"><%#Eval("Title")%></asp:LinkButton>
</HeaderTemplate>
<ContentTemplate>
<asp:Repeater id="repeaterEstimator" runat="server">
<ItemTemplate></ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:Accordion>
I want to fire ItemCommand event on clicking the link button and in the code behind run some business logic based on the CommandName.
void Accordion1_ItemCommand(object sender, CommandEventArgs e)
{
if (e.CommandName == "Select")
{
int index = Accordion1.SelectedIndex;
if(index>0) {
//Execute some business logic here
}
}
}
The ItemCommand event is not firing when I click the button.
I am using Ajax Toolkit dll version:3.5.51116.0
Thanks,
Saikat