Saturday, March 24, 2012

DropDownList Progress Bar - Very Large amount of data

I was wondering how to go about simulating a quick load of a page with AJAX. It takes 10 seconds to populate a huge dropdownlist (large size required). So I have a page that is blank for 10 seconds before showing any activity. The dropdownlist is populated using a code behind procedure calling an SQL 2005 DB SP.

Is it possible to load the page then fill the dropdown list with a progress indicator. (Or just an overall page loading indicator) I'd really appreciate any ideas or examples as I'm a wee bit mentally fatigued tonight :/. Thanks in advanced!

You can use?an asp:UpdatePanel?with?an?asp:UpdateProgress?to?load?data?from?database?and?fill?in?the?asp:DropDownList.
Here?are?some?sample?codes?for?your?reference.
<asp:UpdateProgress ID="UpdateProgress1" Visible="true" DisplayAfter="1" runat="server" AssociatedUpdatePanelID="udpUpperRight">
<ProgressTemplate>
????Loading...
</ProgressTemplate>
</asp:UpdateProgress
<table width="100%">
<tr>
<td valign="top">
<asp:PlaceHolder ID="pnlUpperLeft" runat="server"></asp:PlaceHolder>
</td>
<td style="width: 8px"></td>
<td>
<asp:UpdatePanel ID="udpUpperRight" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Label ID="lblDisply" runat="server" Text="This is asp:UpdateProgress testing"></asp:Label>
<br />
<asp:Image ID="img" runat="server" ImageUrl="~/images/Amazon.gif" />
<asp:Button ID="btnUpdate" runat="server" Text="Update Progress" OnClick="btnUpdate_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table
Behind Code:
protected void btnUpdate_Click(object sender, EventArgs e)
{
????//Load data from database and fill out the asp:DropDownList
}

Wish?the?above?can?help?you.

Cool thanks Ji!

You've certainly opened up my eyes to more features of the update panel. Cheers!

I'm guessing I should substitute in a dropdown where the image is. Is there a way perform the button click coded behind at load? Either way I will experiment. Thanks for the help.

No comments:

Post a Comment