0

TabContainer でページを分割しました。

以前は、このページは、DropDownList に入力する CascadingDropDown で動作していました。現在、この DropDownList は別のタブにあります。そのため、このページを表示しようとすると、「Object Reference Null」という例外が発生します。

別の Tab で値を変更すると、別の Tab に DropDownList をロードするためにどのように実行されましたか?

アップデート:

ご回答ありがとうございますが、残念ながらうまくいきません。

TabContainer の外で CascadingDropDownExtender を試してみましたが、 Reference null が再びキャッチされます。子 DropDownList と同じパネルに CascadingDropDownExtender を使用すると、親コントロールが見つからないという JavaScript アラートが表示されます。

ここで、子 DropDownList と同じ Panel に CascadingDropDownExtender を使用したコード

<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 のみで管理したいと考えています。

4

1 に答える 1

0

CascadingDropDownExtender は最初のタブ内にありますか? そうである場合、CascadingDropDownExtender をタブ コンテナーの外側に完全に引っ張ると、問題は解決しますか? マークアップを投稿すると、これをより簡単に解決できます...

HTH。

于 2010-06-01T15:54:27.017 に答える