I recently upgrade this configuration:
ASP.NET 2.0
AjaxControlToolkit, 1.0.20229.0
System.Web.Extensions, Version=2.0.0.0
To
ASP.NET 3.5
System.Web.Extensions, Version=3.5.0.0
AjaxControlToolkit , Version=3.5.40412.0
I have the following structure:
<asp:ToolkitScriptManager ID="PageScriptManager" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Always">
<ContentTemplate>
<ajaxToolkit:TabContainer
OnActiveTabChanged="TabContainerCarga_ActiveTabChanged"
AutoPostBack="True">
<ajaxToolkit:TabPanel
ID="tabRelatorios"
runat="server"
HeaderText="Relatórios">
<ContentTemplate>
<CustomUserControl:relatorios id="CustomControl" Visible="False" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="CustomControl" />
</Triggers>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ... />
<ajaxToolkit:TabPanel ... />
<ajaxToolkit:TabPanel ... />
<ajaxToolkit:TabPanel ... />
All the has the same first structure. At the serverside code, I have:
protected void TabContainerCarga_ActiveTabChanged(object sender, EventArgs e)
{
//handles TabPanels show/hide and fill up forms grids.
}
CustomControl has a grid which has some post-backs to perform operation like adding and removing records. When CustomControl loads it fills two <asp:DataGrid /> components.
<asp:DataGrid /> load a list
with some text box, which the user
may fill out and press a button to
add records. <asp:DataGrid
/> show any entered information. To history purposes.The strange known behavior is, it actually fire ActiveTabChanged twice. In the first time, it act like I'm loading the CustomControl state for the first time and them goes do the event.
I can't use some solution I've seen like set isFormLoaded flag or even fire a javascript postBack function.
I think about placing a IsLoaded flag structured in a ViewState inside the control. And restart it after any fired event inside the custom control.
What do you think about this and there is any solution arround?
I couldn't solve this problem because it comes from the internal mechanics of this component. I wouldn't go through that jungle. So I asked a designer to draw cool tabs for me and wrote my own tab control using AJAX and Rest Services style. That's it! The behavior I wanted now I have it and works pretty nice now; controllable and loads less JavaScript code into the client machine. Stop using that shit!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With