Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
heyy..


I use a tab container (ajax tab container)and I have 3 tab panels ..My problem is
if I enter a textbox in 2nd tabpanel and then enter,the button in the 1st tab panel
is working....(or event in 1st tab panel is call)...how can I solve this...
Posted

1 solution

Use the following code to select which tab should be loaded inside the pageLoad() function in C#.
protected void Page_Load(object sender, EventArgs e)
{
  if(firstEnterButton.clicked)
  {
    TabContainer1.ActiveTab = TabContainer1.Tabs[0];
  }
  else if(secondEnterButton.clicked)
  {
    TabContainer1.ActiveTab = TabContainer1.Tabs[1];
  }
}


Use can use various options such as Querystring to make this work.

Like on clicking the first Enter button, the page should be reloaded using Response.Redirect() function with the path as "yourpage.aspx?page=1"

C#
protected void enter1_Click(object sender, EventArgs e)
{
  Response.Redirect("yourpage.aspx?page=1");
}


and in the PageLoad function, use the if condition as

C#
if (Page.Request.QueryString["page"] == "1")
        {
            TabContainer1.ActiveTab = TabContainer1.Tabs[0];
        }


and so on.. Its upto you how to use it.

Regards.,
Sriram
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900