Client method called by RegisterStartupScript is firing but UI isn't updating

Can somebody look at the below code and tell me what I am doing wrong.
I am uploading files and need to report back to the client when each
upload has completed.

for(i=0;i<=Request.Files.Count;i++)
{

int percentComplete = (int)Math.Ceiling((double)(i + 1) / (double)
Request.Files.Count * 100);

string message = string.Format("{0} of {1} uploaded", i + 1,
Request.Files.Count);

ScriptManager.RegisterStartupScript(this, this.GetType(), "progress" +
i, @"do_progress('" + message + "','" + percentComplete + "');",
true);

}

I am not seeing the results update in real-time on the client. The
progress bar isn't moving and the counter (n of n files) isn't doing
anything. But, when I look at the innerHTML, the values have updated.
Very odd. It is almost like I need to be refreshing the page but that
shouldn't be necessary.

The client side function I am using, which is placed in the form tags
at the end of the page, looks like this:

function do_progress(message,percent)
{
   try {
        $('progress_status').innerHTML = message;
        $('progress_bar').attr("style", percent + "px");
    }catch(e){alert(e.message)};
}

Thanks.
0
pbd22
12/17/2009 8:39:46 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

1 Replies
769 Views

Similar Articles

[PageSpeed] 50

browsers are a request / response. a file upload is a post request, the 
response will not be sent until the files are uploaded.

if you use the request.files collection, your asp page processing will 
not start until the server has received all the files anyway.

if you want progress during upload, you need to post the file to an 
iframe, use a special hander on the server that tracks the upload 
status, and an ajax routine that polls the server for the status.

i believe the lastest ajax toolkit has one.


-- bruce (sqlwork.com)

pbd22 wrote:
> Can somebody look at the below code and tell me what I am doing wrong.
> I am uploading files and need to report back to the client when each
> upload has completed.
> 
> for(i=0;i<=Request.Files.Count;i++)
> {
> 
> int percentComplete = (int)Math.Ceiling((double)(i + 1) / (double)
> Request.Files.Count * 100);
> 
> string message = string.Format("{0} of {1} uploaded", i + 1,
> Request.Files.Count);
> 
> ScriptManager.RegisterStartupScript(this, this.GetType(), "progress" +
> i, @"do_progress('" + message + "','" + percentComplete + "');",
> true);
> 
> }
> 
> I am not seeing the results update in real-time on the client. The
> progress bar isn't moving and the counter (n of n files) isn't doing
> anything. But, when I look at the innerHTML, the values have updated.
> Very odd. It is almost like I need to be refreshing the page but that
> shouldn't be necessary.
> 
> The client side function I am using, which is placed in the form tags
> at the end of the page, looks like this:
> 
> function do_progress(message,percent)
> {
>    try {
>         $('progress_status').innerHTML = message;
>         $('progress_bar').attr("style", percent + "px");
>     }catch(e){alert(e.message)};
> }
> 
> Thanks.
0
bruce
12/18/2009 4:05:26 AM
Reply:

Similar Artilces:

Cost Update Method for Item Cost
In MS RMS SO (2.0) I have selected "Weighted Average" for the "Cost Update Method" in File - Configuration - Inventory tab. In the online help it reads: ============================== Weighted Average: Select this method if you want Store Operations to update the item cost based on an average cost of all units of that item. When you receive new items, Store Operations adds the total cost of the unit received to the total cost of the existing units. This total cost is then divided by the total number of units on hand. For example, assume you have in stock 20 hammers ...

Calender not updated with Appointment
Hi I have recieved a meeting request, but am unable to accept it. It also does not put a tentative appointment on my calender. I am using Microsoft Outlook 2003. Please can someone tell me how to do this ...

Soap client
Hello. How could I consume Web services created using c# with soap client written on c++6.0 ? I can't use .net on client app. Thanks in advance. Look for the COM-based SOAP Toolkit on the MSDN download web site [0]. Check out the MSDN Library [1] for some articles on interoperability issues. -- HTH Christoph Schittko [MVP] Software Architect, .NET Mentor [0] http://www.msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/948/msdncompositedoc.xml [1] http://msdn.microsoft.com/library "Ulan" <usametov@hotmail.com> wrote in messa...

Unable to Install Microsoft Office 2004 Updates
I tried both the auto-update from within an individual office product (Excel) as well as the download from the Microsoft website. In both cases I am able to download the update, but once it starts it gives me an error message that says: Software could not locate the correct version of the software reqruired to install this update. Upon checking Component Plugin it shows that I have installed 11.2.5 (060523). I have tried to install Office 2004 Update 11.2.6 as well as 11.3.0 and neither one works - both give me the same error as above. Office 2004 works fine and I have no problems running...

Installing multiple Sales for Outlook clients
Is it possible to install multiple Sales for Outlook clients via script/msi upon user log on to network, or must all clents be installed MANUALLY? jorgen.b Jorgen Many have trid to figure this out but I have not heard of anyone having any success with automating the install of SFO. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On 18 Jan 2005 05:08:49 -0800, "jorgen.b" <lunarleaper@yahoo.com> wrote: Is it possible to install multiple Sales for Outlook clients via script/msi upon user log on to network, or ...

DataGridViewComboBoxColumn change to automatically update DataGridView
I have a standard DataGridView. One of the columns is a DataGridViewComboBoxColumn. When I select one of the ComboBox items, I want to trap the change and add additional columns based on the item selected in the ComboBox. I've tried using CellValueChanged for the DataGridView column, and a bunch of other events, but none of them is fired when the DataGridViewComboBox value is changed. What event can I trap to make this happen? Right now as I said, I am using CellValueChanged, but of course the event doesn't fire until I click on another cell... -- Message posted via DotNetM...

HQ Client Server over VPN
In the HQ Client configuration, many of you state that the IP address should be entered for the remote server address in stead of server name. Which IP address is that when you are connecting from a laptop(HQ server) to PC inside the store (HQ client) over VPN? I could be accessing from home or Starbucks and the IP on the laptop changes. Also, since I connect to 2 stores, each store network assigns a different DHCP Ip to the laptop when connected via laptop. ...

Payroll update hangs
Has anyone else had problems with the payroll update engine? This is the first time I'm using it as I just upgraded to 7.0 this spring. Our SUTA accrual was ignoring the wage limit and calculating the tax based on all wages, not just taxable ones. Our VAR told us to apply the R4 tax update even though it didn't seem to apply to us. I applied the update through the Payroll Update Engine on my workstation, and it fixed the report! However, the other workstations still calculate incorrectly, even though they all share a common Reports.dic. I tried applying the tax update a...

Block attachment size at Client
hi Is there anyway to limiting user using MS Outlook to attachment document which is more than 5MB? thanks "gbkhor" wrote in message news:OfmjM8pVIHA.3556@TK2MSFTNGP02.phx.gbl... > > Is there anyway to limiting user using MS Outlook to attachment > document which is more than 5MB? Sure. As the mail admin, you should be able to configure what is the maximum size of your customer's e-mails. gbkhor <gbkhor@time.net.my> wrote: > Is there anyway to limiting user using MS Outlook to attachment > document which is more than 5MB? You may be able to ...

OL 2003 with latest Office Update for Junk Mail
Yesterday I downloaded the latest automatic update for Outlook 2003 pertaining to Junk Mail filtering. Prior to the update, using Cached Exchange Mode and a HIGH junk Mail filter setting, OL caught virtually 100% of the spam. Now, it catches significantly less. What gives MS? Not sure... but FWIW, others noticed the same thing. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Search for answers: http://groups.google.com Most recent posts to the Outloo...

Update Cell in Multiple Sheets
My apologies if I have done this incorrectly. After closing off a previous post I added to this question. Is there someway to select and update Multiple Worksheets in a Macro, I have tried a couple of ways below I have included my latest code. Sheets(Array("Regional Freight-QNRFA", "Int Retail-QNIMR", "Int Wholesale-QNIMW", _ "Passenger-PS", "Network-NW", "Infrastructure-IS", "Workshop-WS", "COMB IS & WS")).Select Dim d As Date d = InputBox("Enter the desired date.&qu...

Installing RMS SP2 on W2K domain controller & clients
Just wanted to know in advance if this is ok. The RMS SP2 directions are very general re: computers, so I assume it doesnt matter, but our server install of RMS is running on a W2Ksp4 DC, with SQL ServerSP2. Dont want to break anything, so any insights are appreciated. The desktops are either XPsp1A or W2K sp3 /sp4. XPsp2 still is causing others hedaches, and really dont want to deal with it right now, have not installed it yet. Thanks Also, our server install is in a data path E:\PROG FILES\MSFT RMS\ETC, not on the C: partition. Is this an issue? I have read the post below re: 10 st...

Recordset Update Issues
I have a button that filters a form filled with dates from two tables. It filters the Season to Seasons and the DevCode to DevCodeA and pulls the marketingname from the current form for display. The dates pulled from the first table are set and do not change (except from the table by a manager) the dates from the second table need to be updateable as they are "actual" dates. Name Set Date Entered Date Milestone Mgr Set Actual Date Right now nothing is updateable. I am getting a recordset not updateable error. I check both date tables and they bo...

Updating 2003 Excel Pivot Chart in 2007
When I go to Chart Toolbar, Design tab, Data/Select Data The Data Range is grayed out I can not click on the Collapse Dialog Button Any help would be greatly appreciated - it used to be so easy and uncomplicated! Thanks CA HR User ...

Outlook 2003 not default MAPI client
I can't get Outlook 2003 set as my default MAPI client. I have answered "yes" when Outlook asks me if I want it to be the default email program, and I have set Outlook as the email program in Internet Explorer (under Tools|Internet Options|Programs). But still, when I click on a link in a browser windows such as someone@microsoft.com, up pops Outlook Express asking if I want it to be the default program. How can I set things so that when I click an email link, I get Outlook 2003, not Outlook Express? Many thanks for your help! Check the file associations for URL:MailTo Proto...

Service Call Mgmt
Need to have an option (perhaps in the Customer Extension records) for a customer price level which affects Labor rates. The default price level in the customer master card only affects parts on the service calls. So, for instance, if there were a "Customer Price Level" on the Customer Extension Card, it would override the Price Level on the Technician Card. This would need to be a flag type option which could be left with current functionality or override - at the customer level. The impetus behind this is we need the ability to offer discounted labor rates to some of our ...

4.0 Client Config error
The Client config returns an error with this in the server log; Exception information: Exception type: HttpParseException Exception message: Could not create type 'Microsoft.Crm.Sdk.Crm2007.CrmDiscoveryServiceAD'. Request information: Request URL: http://toshiba2002:5555/MSCRMServices/2007/AD/CrmDiscoveryService.asmx Request path: /MSCRMServices/2007/AD/CrmDiscoveryService.asmx The web client works OK, and I also get this same error when I try to connect the DMManager. The Server is SBE. Any ideas? -- Thanx Grizz Dear see this http://support.micros...

Outlook Client: Syncronise other peoples calendars
Hi, Is it possible to let the Outlook client bring in other peoples appointments in CRM. We want all our sales team to see all appointments in Outlook, We this to happen by default rather than having to add attendees each time. -- Thanks in advance Chris ...

Update for Windows Vista (KB976662) has failed to install
Can anyone help, I have tried on numerous occasions to update the above but on every occasion as failed "Echo8" wrote: > Can anyone help, I have tried on numerous occasions to update the above but > on every occasion as failed Echo8 wrote: > Can anyone help, I have tried on numerous occasions to update the > above but on every occasion as failed mes wrote: > I also keep getting a not repsonding Nothing like tacking onto an existing conversation and ignoring the request for more information just like the original poster. ;-) -- Shena...

MSCRM 3.0 Emails Not Sent from Laptop Client.. Works from Web Client
I'm attempting to chase down an issue with e-mail here. For some reason, our users using the Laptop client are experiencing an issue where after sending an e-mail through the E-Mail Activity, the e-mail appears properly in the History window, but the recipients never receive the message. >From the web client, this works without issue. I tested using both clients sending an e-mail activity to myself at both my internal corporate e-mail address and to my Gmail address. Both the e-mails from the web client arrived in their respective inboxes, the 2 sent from the laptop client did not. ...

Updates are really annoying
Boy it is really getting to be a pain-in-the-'you-know-what' to keep getting all these d---n updates each week.. How could Microsoft have that many holes in its operating system???? Each time my computer downloads the updates it takes a long, long time and then the computer shuts down and restarts. After that, in most cases there is a complete slowdown with my system and lasts for a day or two before it comes back to normal.. What the devil is happening? It is really annoying... I have a Vista Ultimate 64bit OS, 6GB memory and usually an 8 to 20MB fast throughput....

Client Server using TCP/IP
Hi there... I want to write a small utility. It should be front- and backend running on different machines. I don't want to handle error correction or timeouts by myself. Communication is TCP/IP. How could I easyly do the communication? CSocket or something else. Thanks in advance Stefan "Stefan Kittel" <stefan.doofnase.kittel.NoSpam@web.de> schrieb im Newsbeitrag news:OFsMb9ijFHA.2644@TK2MSFTNGP09.phx.gbl... > Hi there... > > I want to write a small utility. > It should be front- and backend running on different machines. > > I don't want to...

Windows Update cannot list out Office 2007's update
I am using Windows 7 and just installed Office 2007. When I go to Windows Update and refresh for Updates, I can only see updates on Windows 7. However, my Office 2007 is freshly installed. So, there must be some updates as I even does not installed SP1 and SP2 yet. Anyone can help me how to enable Office Update? Thanks for your help. "Victor Tam" wrote: > I am using Windows 7 and just installed Office 2007. > > When I go to Windows Update and refresh for Updates, I can only see updates > on Windows 7. You have to opt-in to Microsoft Update. For Wi...

How a MFC application call a generic method in C# dll?
We have an apllication in MFC. It needs call a generic mehod in a dll that is written in C#. How to do it? Thanks for any help. Haiping Maybe this article will give you some insight. Basically, you need a mixed-mode program that can have managed and unmanaged code. http://www.mastropaolo.com/2005/05/28/c-mixed-mode-applications/ Tom "Haiping" <Haiping@discussions.microsoft.com> wrote in message news:D79BCD4F-42D2-4374-A753-652667F9BFE4@microsoft.com... > We have an apllication in MFC. It needs call a generic mehod in a dll that > is > written in C#. How to do...

transferdatabase method question
Hello,I am importing a query from a database as a table in another database(.accdb) file.I have the following code which works OKDoCmd.TransferDatabase _ acImport, "Microsoft Access", _ strPathDB, _ acTable, _ "old_Final", "new_FINAL"The question is - is this query (old_Final) updated /run before beingimported to the new .accdb file? I mean is the data I get fresh fromthat another database?ThanksAivarsUsing Access 2007 Queries don't actually contain data so anytime they are run, it canonly act on the data that exists...