Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UpdateProgress not working

Status
Not open for further replies.

sirnose1

Programmer
Nov 1, 2005
133
US
I have an application that uploads an excel spreadsheet to a gridview. The gridview is then loaded into a table in a database. That works fine, but the updateprogress control will not display. Any help would be greatly appreciated. Here is the asp.net code:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="content">
Select file:
<asp:UpdatePanel runat="server" ID="pnlUpload">
<Triggers>
<asp:postBackTrigger ControlID="btnRunImport" />
</Triggers>
<ContentTemplate>
<fieldset>
<asp:FileUpload ID="fuGroupAwarenessXLS" runat="server" />
<asp:Button ID="btnRunImport" runat="server" Text="Upload" OnClick="btnRunImport_Click" />
<br />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress runat="server" ID="uplGroupAwareness" AssociatedUpdatePanelID="pnlUpload" >
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/ADMIN/new/PRIVATE/GAINSHARE/group_growth/ajax-loader.gif" />
</ProgressTemplate>
</asp:UpdateProgress>

</div>
</form>

</asp:Content>

VB.net code


Protected Sub btnRunImport_Click(sender As Object, e As EventArgs) Handles btnRunImport.Click
ImportToGrid()
End Sub
 

The default delay to display the update progress panel is .5 seconds. If the time it takes to bind the grid is less that the progress panel will not appear. You can set the DisplayAfter property in the UpdateProgress markup to 0 to show it right away.


Code:
<asp:UpdateProgress runat="server" ID="uplGroupAwareness"
 AssociatedUpdatePanelID="pnlUpload" DisplayAfter="0" >


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Even after adding the Display after = 0 the image still will not show. I still get the waiting.. notification and the data loads into the table but the image still will not show. Am I supposed to add some javascript or something? This is really baffling me.
 
Got it! I was missing the Javascript code.

<script language="javascript" type="text/javascript">
function displaywaitmsg() {
var updateProgress = $get("<%= uplGroupAwareness.ClientID%>");
updateProgress.style.display = "inline-block";
document.getElementById('imgLoading').style.display = "none";
document.getElementById('pnlUpload').innerHTML =
'<asp:Image ID="imgLoading" runat="server" ImageUrl="~/nnnnnnnn/ajax-loader.gif" /><br/><strong>Uploading....</strong>';
}
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top