Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax
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 6-Jan-13 20:52pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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"
 
protected void enter1_Click(object sender, EventArgs e)
{
  Response.Redirect("yourpage.aspx?page=1");
}
 
and in the PageLoad function, use the if condition as
 
if (Page.Request.QueryString["page"] == "1")
        {
            TabContainer1.ActiveTab = TabContainer1.Tabs[0];
        }
 
and so on.. Its upto you how to use it.
 
Regards.,
Sriram
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100