简体   繁体   中英

AJAX TabContainer containing user controls

Wondering if someone here can help. I have an AJAX tabcontainer which has a number of tabs and each tab contains a user control. When I add a new item from one of the tabs, it is not reflected in the user control in another tab unless a postback occurs. (eg the first tab has a listview where I add a new record and the second has a simple form which contains a drop-down which I expect to contain value added from first tab). How can I make the tabcontainer to refresh its tabs from a usercontrol? Any help will be most appreciated.

Thanks, Ali

You could fire an event from your first user control so that the page can handle this event and tell the other usercontrol to databind

Here is a example

<act:TabContainer ID="TabContainer2" runat="server" CssClass="EmployeeProfile" ActiveTabIndex="0">
<act:TabPanel ID="TabPanel1" runat="server" HeaderText="Datos Generales">
  <ContentTemplate>
    <br />
    <uc1:EmployeeGeneralDetails ID="EmployeeGeneralDetails2" runat="server" OnUpdated="EmployeeGeneralDetails2_OnUpdated" />
  </ContentTemplate>
</act:TabPanel>
<act:TabPanel ID="TabPanel2" runat="server" HeaderText="Referenias Personales">
  <ContentTemplate>
    <uc3:EmployeeResumeView ID="EmployeeResumeView2" runat="server" />
  </ContentTemplate>
</act:TabPanel>
</act:TabPanel>

 protected void EmployeeGeneralDetails2_OnUpdated(object o, EventArgs e)
{
  EmployeeResumeView2.DataBind();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM