none
ajax updateprogress 無法使用於 DropdownList SelectedIndexChanged 事件 RRS feed

  • 問題

  • 小弟寫程式時發現當updatepanel裡是放Dropdownlist時,updateprogress控件對於該updatepanel的非同步更新無反應,不會顯示updateprogress的templete,

    不知為何,看過國外網路上有相關討論,但都未解,請問原因有那些,我的程碼那邊有問題???

    <table style="width:100%;" border="0" cellpadding="0" cellspacing="0">
            <tr ><td> &nbsp;</td></tr>
            <tr align="center"><td> 
                <asp:Label ID="TitleLabel" runat="server" Text="Inverter Error Code Query" 
                    Font-Size="Large" Font-Bold="True" Font-Underline="False"></asp:Label></td></tr>
            <tr align="center"><td>
                <table style="width:90%;" border="0" cellpadding="0" cellspacing="0">
                    <tr align="left"><td>
                        <asp:UpdatePanel ID="UpdatePanel_DDLSiteZone" runat="server" UpdateMode="Conditional">                          
                            <ContentTemplate>
                                <asp:Label ID="SiteLabel" runat="server" Text="Select Site:" Font-Bold="True"></asp:Label>
                                <asp:DropDownList ID="DDLSite" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>
                                &nbsp;&nbsp;
                                <asp:Label ID="ZoneLabel" runat="server" Text="Zone:" Font-Bold="True"></asp:Label>
                                <asp:DropDownList ID="DDLZone" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="DDLSite" 
                                    EventName="SelectedIndexChanged" />                            
                            </Triggers>
                         </asp:UpdatePanel>
                    </td></tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr align="left"><td>
                        <asp:UpdatePanel ID="UpdatePanel_DDL" runat="server" UpdateMode="Conditional">                          
                            <ContentTemplate>
                                <asp:DropDownList ID="DDLINVS" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:DropDownList ID="DDLDAYS" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:DropDownList ID="DDLSTATUS" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:DropDownList ID="DDLERRORS" runat="server" BackColor="#EEEEEE" 
                                    AutoPostBack="True">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="BtnReset" runat="server" Text="Reset Selection" 
                                    BackColor="White" BorderColor="#666666" />
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="DDLSite" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="DDLZone" 
                                    EventName="SelectedIndexChanged" />
                            </Triggers>
                       </asp:UpdatePanel>
                    </td></tr>
                    <tr style="height:15px"><td align="center">
                         <asp:UpdateProgress ID="UpdateProgress_QErrCode" runat="server" 
                                            AssociatedUpdatePanelID="UpdatePanel_DDL">
                            <ProgressTemplate>
                                  <asp:Image ID="ImgLoading_QErrCode" runat="server" ImageUrl="~/images/loading.gif" />
                             </ProgressTemplate>
                         </asp:UpdateProgress>
                         <asp:UpdateProgress ID="UpdateProgress_DDLSite" runat="server" 
                                            AssociatedUpdatePanelID="UpdatePanel_DDLSiteZone">
                            <ProgressTemplate>
                                <asp:Image ID="ImgLoading_DDLSite" runat="server" ImageUrl="~/images/loading.gif" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                        <asp:UpdateProgress ID="UpdateProgress_DDLZone" runat="server" 
                                            AssociatedUpdatePanelID="UpdatePanel_DDLSiteZone">
                            <ProgressTemplate>
                                <asp:Image ID="ImgLoading_DDLZone" runat="server" ImageUrl="~/images/loading.gif" />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td></tr>
                    <tr><td>
                        <asp:UpdatePanel ID="UpdatePanel_ErrGv" runat="server" UpdateMode="Conditional">                          
                            <ContentTemplate>
                                <table style="width:100%; border: 1px solid black;"  cellpadding="0" cellspacing="0">
                                    <tr align="left">
                                        <td style="border:1px solid black; background-color:#CCD0F2;">
                                            <asp:Label ID="DateLabel" runat="server" Font-Bold="True"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr align="left">
                                        <td style="border:0px solid black;">
                                            <asp:GridView ID="INVErrGv" runat="server" Width="100%" 
                                                AutoGenerateColumns="False" AllowSorting="True">
                                                <AlternatingRowStyle BackColor="#D0D0D0" />
                                                <Columns>
                                                    <asp:BoundField DataField="nRS485ID" HeaderText="Inverter" 
                                                        SortExpression="nRS485ID">
                                                    <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        Font-Bold="True" Font-Size="Small" Font-Underline="False" ForeColor="Black" />
                                                    <ItemStyle BackColor="Red" BorderColor="Black" BorderStyle="Solid" 
                                                        BorderWidth="2px" HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="sDataKey" HeaderText="EventsDate" 
                                                        SortExpression="sDataKey" >
                                                    <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        Font-Bold="True" Font-Size="Small" ForeColor="Black" />
                                                    <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="InvStatus" HeaderText="Status" 
                                                        SortExpression="InvStatus" >
                                                    <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        Font-Bold="True" Font-Size="Small" ForeColor="Black" />
                                                    <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="sErrName" HeaderText="Error" 
                                                        SortExpression="sErrName" >
                                                    <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        Font-Bold="True" Font-Size="Small" ForeColor="Black" />
                                                    <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" 
                                                        HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                </Columns>
                                                <HeaderStyle 
                                                    BackColor="#CCD0F2" />
                                                <RowStyle BackColor="#C0C0C0" BorderStyle="Solid" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="DDLINVS" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="DDLDAYS" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="DDLSTATUS" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="DDLERRORS" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="BtnReset" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="DDLSite" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="DDLZone" 
                                    EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td></tr>
                </table>
            </td></tr>
            <tr ><td> &nbsp;</td></tr>
        </table>

    2013年1月2日 上午 05:24

解答

所有回覆