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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I display a counter or progress bar on ASP.NET 4. 0 page, I can't use AJAX

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have a page that is reading 7000 records from aa text file and importing them in to SQL Server.
And I can't do a bulk import into SQL, don't have permission.
Is there a way to have some kind of indicator as to wher eit is in the progress of this. I litteraly take 5 minutes to load them, so I want something on the screen to show the user where it is.
this does not work until the end then it shows 7095
Code:
While True
    counter += 1
    If Counter Mod 100 Then
        Me.lblResult.Text = "Imported so Far: " & Counter.ToString
    End If
End While

DougP
 
I added the 'UpdateProgress1' .
here is the error whenh I try and run the page.

The control with ID 'UpdateProgress1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

What does that mean?

DougP
 
You need the ajax script manager on the page. It has to be the first control on the page.
 
Ok I found this out. bbut how to I make it move? or what can I do to show some kind of progress

While True
counter += 1
If Counter Mod 100 Then
Me.lblResult.Text = "Imported so Far: " & Counter.ToString
CAN I PUT SOMETHING IN HERE?
End If
End While
Add code to web.config
Code:
  <runtime>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
  </runtime>

this is on the WEB page where the updater is
Code:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
</asp:UpdateProgress>


DougP
 
You can try using a background worker to accomplish this. See post here.

Or a homegrown method found here. It is in C#, though.

Good luck!

-Mark


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top