Hi
Iam able to create the ajax accordian control.In contentTemplate I had created the Button with the name of "Fill" and added the event onitemcommand ,
Iam facing the problem with the event.it was firing sometimes and it was not firing sometime, please Help me
I had created the Accordian Control with the dynamic button control
<asp:Accordion ID="Accordion1" runat="server" ContentCssClass="accordionContent"
FadeTransitions="true" FramesPerSecond="250" HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeaderSelected" OnItemCommand="Accordion1_ItemCommand"
TransitionDuration="50" EnableTheming="True" RequireOpenedPane="False" SuppressHeaderPostbacks="True">
<HeaderTemplate runat="server">
</HeaderTemplate>
<ContentTemplate runat="server">
<table width="100%">
<tr>
<td>
</td>
<td>
<asp:Button ID="Button3" runat="server" CommandName="Scrap" Text="Scrap" />
</td>
<td>
<asp:Button ID="Button4" runat="server" CommandName="fill" Text="Fill" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:Accordion>
I am firing the event
as
protected void Accordion1_ItemCommand(object sender, CommandEventArgs e)
{
if (e.CommandName == "fill")
{
}
}
This event may or maynot fire,
ex: for one time it fires
another time may or maynot fires
......
just like that
In page load code is
if (!IsPostBack)
{
pageno = 0;
PagedDataSource pg = new PagedDataSource();
pg.AllowPaging = true;
pg.PageSize = 10;
pg.CurrentPageIndex = pageno;
LinkButton1.Visible = true;
LinkButton2.Visible = true;
con = new MySqlConnection(ConfigurationManager.ConnectionStrings["tablename"].ConnectionString);
MySqlCommand cmd = new MySqlCommand("some query", con);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "invoicereview");
pg.DataSource = ds.Tables["tablename"].DefaultView;
LinkButton1.Enabled = !pg.IsFirstPage;
LinkButton2.Enabled = !pg.IsLastPage;
Accordion1.DataSource = pg;
Accordion1.DataBind();
}
Here i am also using the paging
so please specify me where excately it was going wrong