我在更新面板中有一个下拉列表。在选定的索引更改事件中,我需要使用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>
答案 0 :(得分:1)
我假设你的意思是“功能”,而不是“文件”。假设,我看到你在auth-logoutlink上有一个点击处理程序。更新面板将“销毁”事件处理程序,因为它在返回数据时重新创建DOM。您必须将onclick事件重新附加到该链接。