【问题标题】:Which event is raised on the client side when the drop down list initially gets loaded?最初加载下拉列表时,客户端会引发哪个事件?
【发布时间】:2011-12-10 06:29:55
【问题描述】:

我有一个下拉列表如下:

 <asp:DropDownList ID="ddlAuthenticationMode" DataMember="AuthenticationMode" runat="server"
                                    CssClass="ddlAuthenticationMode" AppendDataBoundItems="true" onchange="onSelectedIndexChange(this.value);">
                                    <asp:ListItem Text="Windows Authentication" Selected="True" Value="Windows"></asp:ListItem>
                                    <asp:ListItem Text="SQL Server Authentication" Value="SqlServer"></asp:ListItem>
                                </asp:DropDownList>

最初加载下拉列表时,客户端会引发哪个事件?

我添加了以下代码来处理加载事件,但它从未引发:

$('.ddlAuthenticationMode').load(function (){

                alert('loaded');          
            });

谢谢,

【问题讨论】:

  • @sll 你的评论没有帮助:p

标签: .net asp.net html drop-down-menu web


【解决方案1】:

最初加载下拉菜单时不会引发客户端事件。它是从服务器发送到客户端的 DOM 的一部分。您可以订阅$(document).ready 事件以确保您可以在客户端上对其进行操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-23
    • 1970-01-01
    • 2013-08-10
    • 2010-09-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多