[英]Reload a .js file on selectedindex change event of dropdown in asp.net
我在更新面板中有一个下拉菜单。 在选定的索引更改事件中,我需要使用 c# 或 javascript 执行一个 .js 文件,我该怎么做?
<asp:UpdatePanel ID="UP_Social_Ddl" runat="server">
<ContentTemplate>
<div class="styled-select">
<asp:Label runat="server"
ID="Label2"
Font-Size="Small"
ToolTip="Social : 'ON' will post your activity on this page to your FaceBook Wall." Text="Social :"
Style="vertical-align: bottom;" />
<asp:DropDownList
ID="ddlSocialSwitch"
runat="server"
AutoPostBack="true"
Style="vertical-align: middle;"
ToolTip="Social : ON will post your activity on this page to your FaceBook Wall."
OnSelectedIndexChanged="ddlSocialSwitch_SelectedIndexChanged">
</asp:DropDownList>
<a valign="bottom" onclick="logout_fb" href="#" id="auth-logoutlink"><img valign="bottom" src="facebookLogOutButton.png"/></a>
<asp:Label ID="lbl" Visible="false" runat="server"></asp:Label>
</div>
</ContentTemplate>
我假设你的意思是“功能”而不是“文件”。 假设,我看到您在 auth-logoutlink 上有一个点击处理程序。 更新面板将“销毁”事件处理程序,因为它在返回数据时如何重新创建 DOM。 您必须将 onclick 事件重新附加到该链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.