I would nest the "functions" into WebUserControls and put them into separate TabPanels. They do nothing on Page.Load and are Invisible. Define a function "BindData" that do all the DataBinding/Time consuming - stuff. When the user changes the ActiveTab (or for the default-active-tab) make that UserControl visible and call its BindData function.
You need UpdatePanels(Updatemode=Conditional) around the UserControl and an Async-Postback-Trigger with Eventname=ActiveTabChanged so that only this Panel is reloaded.
For example on ASPX(MD_Location is the UserControl, for lack of space i only posted one but you must imagine a lot of them):
<act:TabContainer ID="TabContainer1" runat="server" AutoPostBack="true" >
<act:TabPanel ID="TabLocation" runat="server" HeaderText="Locations">
<ContentTemplate>
<asp:UpdatePanel ID="UpdLocation" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<MD:MD_Location id="MD_Location" runat="server" Visible="false" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TabContainer1" EventName="ActiveTabChanged" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</act:TabPanel>
and in the Codebehind (sorry, only VB.Net available, i hope you get the idea):
Private Sub TabContainer1_ActiveTabChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabContainer1.ActiveTabChanged
If Me.TabContainer1.ActiveTab Is Me.TabLocation Then
Me.MasterDataType = "Locations"
End If
switchControlVisibility()
End Sub
Private Sub switchControlVisibility()
Select Case Me.MasterDataType.ToLower
Case "locations"
Me.MD_Location.Visible = True
Me.Lblheader2.Text = "Locations"
UpdHeader.Update()
Me.MD_Location.BindData() '<---- do time-consuming stuff
Me.UpdLocation.Update()
End Sub
Example