Ajax UpdateProgress现在将显示在tabContainer中

时间:2013-03-23 19:51:40

标签: ajax visual-studio-2010 updatepanel updateprogress

我正在使用visualStudio 2010 vb

我在TabContainer中有一个UpdateProcess,我无法让它显示加载图像。我在下面添加了示例代码。我错过了一些东西让它显示出来?

<asp:TabContainer ID="TabSelection" runat="server" ActiveTabIndex="0" 
        Width="1126px" Font-Bold="True" TabStripPlacement="Top" 
        style="margin-right: 34px; margin-top: 49px;" AutoPostBack="True">
  <asp:TabPanel runat="server" HeaderText="Scorecard3" ID="TabScorecard3">
   <HeaderTemplate>
     Scorecard
   </HeaderTemplate>

        <ContentTemplate>

<asp:UpdateProgress ID="UProc_Scorecard" runat="server" AssociatedUpdatePanelID="UP_Scorecard"
  DisplayAfter="1">
<ProgressTemplate>
     <asp:Image id="wait" runat="server" ImageUrl="~/Images/wait3.gif" />
</ProgressTemplate>
</asp:UpdateProgress>

        <asp:UpdatePanel ID="UP_Scorecard" runat="server"> 
         <ContentTemplate>

        … 3 Grids and 3 tables …

        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="DateSelection" 
                EventName="SelectedIndexChanged"/>
                <asp:AsyncPostBackTrigger ControlID="GroupSelection" 
                EventName="SelectedIndexChanged"/>
        </Triggers>
        </asp:UpdatePanel>

    </ContentTemplate>
  </asp:TabPanel>
</asp:TabContainer>

由于

1 个答案:

答案 0 :(得分:0)

我已经通过在TabContainer外部移动UpdateProgress和updatePannel解决了这个问题,我还删除了tabcontainer中的autopostback,以防止每次选择选项卡时都进行回发。我希望这可以帮助别人。下面的示例代码......

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>

<asp:UpdateProgress ID="UProc_TabContainer" runat="server" AssociatedUpdatePanelID="UP_TabContainer"
    DisplayAfter="1">
    <ProgressTemplate>
        <div id="dvProgress" runat="server" style="position: absolute; top: 300px; left: 450px;
            text-align: center;">
            <asp:Image ID="wait" runat="server" ImageUrl="~/Images/wait3.gif" Height="120px"
                Width="128px" />
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>

<asp:UpdatePanel ID="UP_TabContainer" runat="server">
    <ContentTemplate>
        <asp:Panel ID="Panel1" runat="server" BackColor="#66FFFF">

                        <asp:DropDownList ID="DateSelection" runat="server" AutoPostBack="True" Height="21px"
                            Width="134px">
                        </asp:DropDownList>

                        <asp:DropDownList ID="GroupSelection" runat="server" AutoPostBack="True" Height="21px"
                            Width="134px" >
                        </asp:DropDownList>

        </asp:Panel>

        <asp:TabContainer ID="TabSelection" runat="server" ActiveTabIndex="0" Width="1126px"
            Font-Bold="True" TabStripPlacement="Top" 
            Style="margin-right: 34px; margin-top: 49px;">
            <%-- AutoPostBack="True"--%>
            <asp:TabPanel runat="server" HeaderText="Scorecard3" ID="TabScorecard3">
                <HeaderTemplate>
                    Scorecard
                </HeaderTemplate>
                <ContentTemplate>
                    … grids and charts …
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel runat="server" HeaderText="Documentation" ID="TabInfo">
                <ContentTemplate>
                    … documentation …
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="Project" runat="server" HeaderText="Project">
                <ContentTemplate>
                    … documentation…
                </ContentTemplate>
            </asp:TabPanel>
        </asp:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>