【问题标题】:AJAX TabContainer containing user controls包含用户控件的 AJAX TabContainer
【发布时间】:2010-04-29 15:25:32
【问题描述】:

想知道这里是否有人可以提供帮助。 我有一个 AJAX tabcontainer,它有许多选项卡,每个选项卡都包含一个用户控件。当我从其中一个选项卡添加新项目时,它不会反映在另一个选项卡的用户控件中,除非发生回发。 (例如,第一个选项卡有一个列表视图,我在其中添加了一条新记录,第二个选项卡有一个简单的表单,其中包含一个下拉列表,我希望包含从第一个选项卡添加的值)。 如何使 tabcontainer 从用户控件刷新其选项卡? 任何帮助将不胜感激。

谢谢, 阿里

【问题讨论】:

    标签: asp.net ajax controls tabcontainer


    【解决方案1】:

    您可以从您的第一个用户控件触发一个事件,以便页面可以处理此事件并告诉另一个用户控件进行数据绑定

    这是一个例子

    <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();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-13
      • 2012-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多