0

我正在使用 jquery 对话框...所以我需要将这一切保存在更新面板中。

我有以下内容:

 <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div id="search">
             <a href="#" onclick="return false;" class="info">Address type:<span>Select whether you want to search 'From' / 'To' type addresses.  Or select both to search all addresses.</span></a>
                <asp:RadioButtonList ID="rbSearchTypes" runat="server" 
                    RepeatDirection="Horizontal" RepeatLayout="Flow">
                    <asp:ListItem>From</asp:ListItem>
                    <asp:ListItem>To</asp:ListItem>
                    <asp:ListItem Selected="True">Both</asp:ListItem>
                </asp:RadioButtonList>
                 &nbsp;| <a href="#" onclick="return false;" class="info">Address created by:<span>Search for your addresses (addresses you have created) / search for any address in the system.</span></a>
                   <asp:RadioButtonList ID="rbSearchMyAddresses" runat="server" 
                    RepeatDirection="Horizontal" RepeatLayout="Flow">
                    <asp:ListItem Selected="True" Value="0">Anyone</asp:ListItem>
                    <asp:ListItem Value="1">Me</asp:ListItem>
                </asp:RadioButtonList>
                 <br />
                <asp:TextBox ID="txtFindSearch" runat="server" Font-Names="Arial" 
                    ToolTip="Enter a search term (ship to name / address / region, etc)."></asp:TextBox> 
                <asp:Button ID="btnFindSearch" runat="server" Text="Search" 
                    onclick="btnFindSearch_Click" BorderColor="#1367AD" BorderStyle="Solid" />
                <hr />
                <br />
                <asp:Label ID="lblRowsCount" runat="server" Text=""></asp:Label>
            </div>
            <div id="searchresults" style="">
                <asp:RadioButtonList ID="rbSearchResults" CssClass="rbsearch" runat="server" AutoPostBack="True" 
                    CellSpacing="10" RepeatColumns="4" RepeatDirection="Horizontal" 
                    ToolTip="Select an address." 
                    onselectedindexchanged="rbSearchResults_SelectedIndexChanged" Width="100%">
                </asp:RadioButtonList>
            </div>
             <div id="loading" style="width:100%;text-align:center;">
               <asp:UpdateProgress ID="UpdateProgress1" runat="server" Visible="True" DynamicLayout="True">
                        <ProgressTemplate>
                            <img style="border-style:none;" src="images/ajax-loader.gif" alt="loading" />
                        </ProgressTemplate>
               </asp:UpdateProgress>      
             </div>
        </ContentTemplate>
        </asp:UpdatePanel>

当我单击btnFindSearch时,我希望在查询我的数据库并提取记录时,我的更新进度条UpdateProgress1会显示我的 ajax 加载 gif。它没有:(...所以它给我的用户一种我的应用程序被卡住的印象,而实际上它实际上是在提取数据。在几秒钟内数据加载单选按钮列表...但我希望我的更新进度会出现。这是因为我单击了更新面板内的按钮吗?有什么办法可以让加载更新进度控件出现吗?

4

1 回答 1

1

我也有同样的问题我对我的代码所做的是,

 <asp:UpdateProgress DynamicLayout="false" ID="UpdateProgress1" runat="server">
    <ProgressTemplate>
        <div class="Progress">
            <img alt="loading" src="images/loading1.gif" />
            &nbsp;
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>

这是从服务器检索数据时加载图像的代码,类的 css 代码Progress是这样的,

 .Progress
 {
   background-color:Transparent;
   color:White;
   width:26px;
 }

.Progress img {
   vertical-align:middle;
   margin:2px;
 }

希望这对你有帮助,祝你好运!

于 2012-04-30T05:22:31.427 回答