-1

我在更新面板中有一个下拉菜单。在选定的索引更改事件中,我需要使用 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>
       &nbsp;<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>

4

1 回答 1

1

I'll assume you mean "function" and not "file". Assuming that, I see that you have a click handler on the auth-logoutlink. update panels will "destroy" the event handler because of how it recreates the DOM when the data is returned. You have to reattach the onclick event to that link.

于 2012-11-08T02:10:05.557 回答