当下拉列表最初加载时,客户端会引发哪个事件?
我有一个下拉列表,如下所示:
<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');
});
谢谢,
I have a drop down list as below:
<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>
Which event is raised on the client side when the drop down list initially gets loaded?
I added the below code to handle the load event but it never raised:
$('.ddlAuthenticationMode').load(function (){
alert('loaded');
});
thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最初加载下拉列表时不会引发客户端事件。它是从服务器发送到客户端的 DOM 的一部分。您可以订阅
$(document).ready
事件,以便确保您可以在客户端上操作它。There is no client side event that gets raised when the dropdown is initially loaded. It is part of the DOM that gets sent to the client from the server. You could subscribe to the
$(document).ready
event in order to ensure that you can manipulate it on the client.