ranjith n

ranjith n

  • NA
  • 98
  • 0

problem with ajax tab container

Nov 2 2007 4:17 AM

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();
        }
    }



Answers (1)