Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Closed Issue: TabContainer's ActiveTabChanged event unexpectedly gets triggered when using dynamically loaded user control [26746]

$
0
0
We have added a TabContainer control with AutoPostBack="true" to user control. The user control is dynamically loaded onto an ASP.NET when the page is loaded. Whenever users click on a tab, clicking on any ASP.NET button on the form (or any control that triggers a postback) will then cause the control to unexpectedly trigger the OnActiveTabChanged event.

Sample WebUserControl1.ascx file:
================================
<ajax:TabContainer ID="TabContainer1" runat="server" OnActiveTabChanged="TabContainer1_ActiveTabChanged" AutoPostBack="true">
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel 1"/>
<ajax:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel 2"/>
</ajax:TabContainer>

Sample Default.aspx file:
================================
<form id="form1" runat="server">
<asp:Button ID="button1" runat="server" Text="Test" />
</form>

Sample Default.aspx.cs file:
================================
protected void Page_Load(object sender, EventArgs e)
{
Control controlFile = Page.LoadControl("WebUserControl1.ascx");
form1.Controls.Add(controlFile);
}

Steps to reproduce:
================================
1) Click on "TabPanel 2" tab, which triggers the OnActiveTabChanged event, which is the expected behavior.
2) Click on the "Test" button, which causes a postback on the form and unexpectedly triggers the OnActiveTabChanged event again with the ActiveTab and ActiveTabIndex properties set to the previously selected tab (TabPanel 2).

Comments: This issue is fixed in the May 2012 release.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>