我正在使用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>
| <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
时,我希望在查询我的数据库并拉取记录时,我的updateprogress bar UpdateProgress1
会显示我的ajax加载gif。它不会:( ...所以它给我的用户留下了我的应用程序卡住的印象,实际上它实际上是在拉数据。几秒钟后数据加载单选按钮列表......但我希望我的更新进度这是因为我点击了一个更新面板内的按钮?有什么办法可以让加载updateprogress控件出现吗?
答案 0 :(得分:1)
我也有同样的问题,我对我的代码所做的是,
<asp:UpdateProgress DynamicLayout="false" ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<div class="Progress">
<img alt="loading" src="images/loading1.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
这是从服务器检索数据时加载图像的代码,类Progress
的css代码是这样的,
.Progress
{
background-color:Transparent;
color:White;
width:26px;
}
.Progress img {
vertical-align:middle;
margin:2px;
}
希望这有助于你,祝你好运!