problem with ajax tab container
I have create some tags dynamically using tabcontainer,for each tab I click I should get some values from database into the gridview in the tabpanel,with paging enabled.I am getting some problem with page numbers,when I click the page numbers it is giving some error.
please tell me the solution.Here is what i did
<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabPanel ID="TabPanel1" runat="server">
</cc1:TabPanel>
</cc1:TabContainer>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
SqlConnection cn = new SqlConnection("server=localhost;uid=sa;pwd=sa;database=pubs");
SqlDataAdapter da = new SqlDataAdapter("select * from authors", cn);
DataSet ds = new DataSet();
gridview gv=new gridview();
gv.AllowPaging = true;
da.Fill(ds, "app");
gv.DataSource = ds;
gv.DataBind();
int count = gv.Rows.Count;
AjaxControlToolkit.TabPanel tp = new AjaxControlToolkit.TabPanel();
tp.Controls.Add(gv);
TabContainer1.Tabs.Add(tp);
lbl.Text = count.ToString();
}
}