2012-04-30 61 views
0

我正在使用jquery對話框...所以我需要將這一切都保存在一個updatepanel中。updateprogress在單擊updatepanel內的按鈕時不顯示?

Ive得到了以下幾點:

<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雖然這是我的查詢數據庫,並拉着我的記錄欄的UpdateProgress將UpdateProgress1顯示出我的AJAX加載GIF我希望。它不會:(...所以它給我的用戶一個印象,即我的應用程序被卡住了,實際上它實際上在拉取數據。幾秒鐘後,數據加載單選按鈕列表...但我希望我的更新進度這是因爲我點擊了一個updatepanel裏面的按鈕嗎?有什麼我可以做的,讓加載updateprogress控制出來嗎?

+0

請參閱[this](http://asp-net-example.blogspot.in/2009/11/ajax-updateprogress-how-to-use.html)文章。它會幫助你 –

回答

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; 
} 

希望這個幫助你,祝你好運!