1

我正在尝试使用 javscript 分配 updateprogess css 值,但是控件的 clientID 正在获取错误的 clientid .. asp.net 的代码是

<div style="display: Block; clear: left;" runat="server" id="DivLike">
   <asp:UpdatePanel ID="UpdatePanelLike" runat="server" UpdateMode="Conditional">
      <ContentTemplate>
         <div style="position: relative;">
            <div style="position: absolute; top: 0px; left: 0px;">
               <asp:LinkButton ID="LinkButtonLike" runat="server" CommandName="<%#Eval("Like_Command") %>" Font-Size="XX-Small" OnCommand="LinkButton2_Command" Text="<%#Eval("Like_Command")%>">
               </asp:LinkButton>
            </div>
            <div class="popupstyle" style="position:absolute; top:0px; left:0px; display:none;" id="DivChapters" runat="server">
               <asp:UpdatePanel ID="UpdatePanelLinkActivity" runat="server" UpdateMode="Conditional">
                  <ContentTemplate>
                     <div>
                        Select Chapter:
                        <asp:DropDownList ID="DropDownListChapters" runat="server" AutoPostBack="true">
                        </asp:DropDownList>
                     </div>
                     <div>
                        Select Topic:
                        <asp:DropDownList ID="DropDownListTopics" runat="server">
                        </asp:DropDownList>
                     </div>
                     <div>
                        <asp:LinkButton ID="LinkButtonAddLink" runat="server" OnCommand="LinkButtonAddLink_Command" Text="Add" CssClass="UtilityClass">
                        </asp:LinkButton>
                     </div>
                     <asp:UpdateProgress ID="UpdateProgressLinkActivity" runat="server" AssociatedUpdatePanelID="UpdatePanelLinkActivity" DynamicLayout="True">
                        <ProgressTemplate>
                           <div style=" position:absolute; top:50%; left:50%; background-color:white;" id="divLoading">
                              <img src="Images/loading25.gif" alt="Loading..." style="" />
                           </div>
                        </ProgressTemplate>
                     </asp:UpdateProgress>
                  </ContentTemplate>
                  <Triggers>
                     <asp:AsyncPostBackTrigger ControlID="LinkButtonAddLink" EventName="Command" />
                  </Triggers>
               </asp:UpdatePanel>
            </div>
         </div>
      </ContentTemplate>
      <Triggers>
         <asp:AsyncPostBackTrigger ControlID="LinkButtonLike" EventName="Command" />
      </Triggers>
   </asp:UpdatePanel>
</div>

JavaScript 代码是这样的:

var updateProgress = document.getElementById('<%=UpdateProgressLinkActivity.ClientID%>');
updateProgress.style.position = 'absolute';
updateProgress.style.width = '250px';
updateProgress.style.height = '100px';
updateProgress.style.top = '0px';
updateProgress.style.left = '0px';

我嵌套了两个更新面板。这可能是问题吗?

4

0 回答 0