0

我正在Multi-select dropdown list为我使用的Ajax Drop-down extender.

代码

<asp:TextBox ID="txtDisplay" runat="server" CssClass="tb10" ></asp:TextBox>
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" 
        Width="280px" style="display :none;visibility: hidden;padding-bottom:-1px;
        margin-top:-28px;margin-left:0px;background-color:#F5F5F5;overflow:hidden;
        height:auto;min-height:100px;max-height:300px;max-width:350px;" >
    <div id="CombClose" style="padding-right:2px;color:#FFFFFF;text-align:right;cursor:pointer;height:35px;background-color:#507CD1;width:100%;" runat="server" >Close</div>
    <br />
    <div runat="server" id="listDiv" style="padding-bottom:-1px;margin-top:-28px; 
        margin-left:0px;background-color:#F5F5F5;overflow-Y:auto;overflow-X:hidden;
        height:200px;max-height:265px;max-width:350px;" >
        <asp:CheckBoxList ID="chkList" runat="server" CssClass="Chklist" OnSelectedIndexChanged="chkList_SelectedIndexChanged" > 
        </asp:CheckBoxList>
        <asp:ListBox ID="list" runat="server">
        </asp:ListBox>
    </div>
</asp:Panel>
<ajaxToolkit:DropDownExtender runat="server" ID="DDE" TargetControlID="txtDisplay" 
    DropDownControlID="DropPanel" HighlightBorderColor="Transparent" OnClientPopup="OnClientPopup" >
    <Animations>
        <OnShow>
            <Sequence>          
                <HideAction Visible="true" />                                          
                <FadeIn  Duration=".5" Fps="10" />         
            </Sequence>
        </OnShow>
        <OnHide>
            <Sequence>                       
                <FadeOut Duration=".5" Fps="10" />
                <HideAction Visible="false" />
                <StyleAction Attribute="display" Value="none"/>
            </Sequence>
        </OnHide>
    </Animations>
</ajaxToolkit:DropDownExtender>

现在我需要在下拉扩展器关闭时调用一个 java-script 函数。任何人都可以指导我如何做到这一点。在这里我使用动画有什么方法可以调用任何 java-script 函数OnHide。如果有什么办法,请指导我。

4

1 回答 1

0

最后我得到了一个解决方案,如何在dropdownextender关闭时调用 java-script 函数。我们可以使用这个来调用javascript函数。

<ScriptAction Script="alert('Dropdown is colsing');" />

完整代码

<ajaxToolkit:DropDownExtender runat="server" ID="DDE" TargetControlID="txtDisplay" 
DropDownControlID="DropPanel" HighlightBorderColor="Transparent" OnClientPopup="OnClientPopup" >
<Animations>
    <OnShow>
        <Sequence>          
            <HideAction Visible="true" />                                          
            <FadeIn  Duration=".5" Fps="10" />         
        </Sequence>
    </OnShow>
    <OnHide>
        <Sequence>                       
            <FadeOut Duration=".5" Fps="10" />
            <HideAction Visible="false" />
            <StyleAction Attribute="display" Value="none"/>
            <ScriptAction Script="alert('Dropdown is colsing');" />
        </Sequence>
    </OnHide>
</Animations>
</ajaxToolkit:DropDownExtender>

现在我的问题解决了。

于 2013-10-15T09:52:50.497 回答