2010-06-01 42 views
0

我用TabContainer分隔了一個頁面。在TabContainer中CascadingDropDown和其他選項卡中的目標

之前,本頁面使用了一個CascadingDropDown來填充DropDownList。 現在,此DropDownList在另一個選項卡中。因此,當我嘗試查看此頁面時,我收到了一個異常「Object Reference Null」。

當我更改不同Tab中的值時,如何在另一個Tab中加載DropDownList?

更新:

謝謝您的回答,但unfortunaly這是行不通的。

我已經嘗試使用TabContainer之外的CascadingDropDownExtender,但引用null再次被捕獲。 CascadingDropDownExtender與子DropDownList在同一Panel中,我有一個JavaScript警報,說父控件找不到。

這裏同一面板的孩子與CascadingDropDownExtender代碼DROPDOWNLIST

<cc2:TabPanel runat="server" HeaderText="Carte Identité" ID="TabCI"> 
<ContentTemplate> 

    <ProspectMgt:MarketSegmentDropDownList ID="MarketSegmentDropDownList1" runat="server" 
      AutoPostBack="false" Width="400px"></ProspectMgt:MarketSegmentDropDownList> 

     <asp:CompareValidator ID="CompareValidator2" runat="server" CssClass="error" ToolTip="Required" 
      ControlToValidate="MarketSegmentDropDownList1" ValueToCompare="-1" Operator="NotEqual" 
      ErrorMessage="MktSegment" Display="Dynamic" Font-Bold="True"></asp:CompareValidator> 

</ContentTemplate> 
</cc2:TabPanel> 
    <cc2:TabPanel ID="TabSize" runat="server" HeaderText="Size & Volume"> 
<ContentTemplate> 

        <asp:DropDownList ID="DropDownListSize" AutoPostBack="false" runat="server"> 
        </asp:DropDownList> 

      <cc2:CascadingDropDown ID="cddSize" runat="server" TargetControlID="DropDownListSize" 
Category="Size" LoadingText="[...]" 
ServicePath="~/Modules/ProspectMgt/WebService/ServiceAjax.asmx" ServiceMethod="GetSizeByMktId" 
ParentControlID="MarketSegmentDropDownList1" /> 

</ContentTemplate>  

</cc2:TabPanel> 

所以我不明白爲什麼它不工作。它沒有TabContainer完美的工作。我正在使用AjaxToolKit 30512.但是,我期待刪除CascadingDropDownExtender並僅通過javascript管理此問題。

回答

0

CascadingDropDownExtender是否在第一個標籤內?如果是這樣,如果將CascadingDropDownExtender完全拉出標籤容器外,是否解決了問題?發佈一些標記將有助於更輕鬆地解決此問題...

HTH。

相關問題