.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

ProgressChanged event randomly fires with BackgroundWorker?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :.NET Framework
I'm using a background worker for a Windows Form app I'm writing - .NET 3.5.

I'm using the background worker so that I can keep my user interface responsive (i.e. don't need to use Application.DoEvents) specifically when using Progressbar and status messages.  However, what I've noticed is that during my DoWork method when I do a .ReportProgress(somevalue, somemsg) it doesn't fire the ProgressChanged event immediately, it often fires longer after I've moved onto other processing. 

The end result is that the Progress bar gets update later than the actual processing being done, in some cases it's way out of synch.  So at this point I'm sorta wondering why I should even bother with Background worker threads when an Application.DoEvents on the main thread will accomplish a more accurate synch'd UI update??

Am I missing something?  Is my choice of BackgroundWorker a bad one?  Should I just go with System.Threading and manage all the work around that rather than trying the more simple BackgroundWorker?

Thanks, Rob.

View Complete Post

More Related Resource Links

AjaxControlToolkit TextBoxWatermarkExtender fires TextChanged Event on every postback


I haven't been able to find anything on the net about this yet. A project that used to work fine all of a sudden started having trouble with a couple users. The TextBoxWatermarkExtenders for these users are now always firing the TextChanged event of the textboxes they are assigned to for every postback. I don't think this is what they are supposed to do. They didn't use to do this. Has anyone else experienced this? I can add code to ignore these unintentional events, but I would like to know why all of a sudden the change in behavior.

Any information about this would be greatly appreciated.


GridView RowDeleting event fires twice !


I'm facing some annoying GridView behavior where it fires the RowDeleting event twice.

I'm doing the very normal (logical) steps for deleting a row from a GridView. Here is what I'm doing:

1- my test Page_Load  method

protected void Page_Load(object sender, EventArgs e)

	GridView1.DataSource = GetDataTable();
	// Note: GetDataTable() returns a non-null DataTable object.
	// Also the DataTable has more than 1 row
	// (i.e. everything is fine with the datatable)

2- the GridView has a Delete Command Field.

3- on tracing I've noticed my RowDeleting event gets fired twice! (also I used a static counter to see how many times the event gets fired when clicking on the GridView delete button, which was also confirmed it that it's counting 2 per each click).

Am I doing something wrong? please help


BeginRequest event fires for all static files


I was under the impression that static files (CSS, images, @font-face files, etc) bypassed ASP.NET completely, and were served directly by IIS.  However, my BeginRequest event handler is being called for every HTTP request, including those for static files.  This concerns me because I'm creating an Entity Framework data context to be used for the lifetime of each request in that event handler.  I don't want to create those contexts if they're never going to be used.  

I'm using IIS 7 on Windows 7 Ultimate with so special handler mappings defined.  Do I have it wrong?  Should these events be firing?

ListView Control, MouseUp event fires twice, once MouseUp and then on MouseHover.


Greetings all,

using: VS2010, Frwk 4.0, Windows7 Ultimate N.

When the ListView's MultiSelect property is set to False, MouseUp is fired twice with one click.

The event is fired when the mouse button is up (which is normal), but then fired again when you move the mouse.

This bug has been reported in Microsoft Connect on June 29 2005,  here... and reported fixed. Its not.


Is there any kind of workaround for this?


thanks in advance for suggestions/ideas here.


Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

Event ID 1011 - DefaultAppPool World Wid Web Pub. Serv. fatal communication error

We have a Windows 2003 server running IIS6 1.1 Framework. We have also installed a DNS and Active Directory in the same machine.

We're randomly getting the error you can see below. Sometimes it causes the recycling of process w3wp.exe (which on my understanding represents the application pool worker processd) and other times results on this process hanging and not responding to any request. To do iisrest temporarly solves the problem.

We were pointed to a possible permissions problem between the user we were runnig the DefaultAppPool with and registry entries used by the iis. We noticed the default predifined user we used, Network Service, wasn't found in the Active Directory, so we changed it by the default configurable user, IWAM_MACHINE_NAME, which is under the IIS_WPG Active Directory Grupo, which, in theory has the correct permissions to run the application pool.

Well, none of this worked and we are still getting this error.

This is driving us crazy and think the problem might have to do with having the Domain Controller/Active Directory and the IIS6 running on the same machine. We'll try now uninstalling this DC pointing to another one to see what happens.

Any help would be appreciated.

Thanks in advance,


Event Type: Warning

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

How to set up microsoft application blocks 4.0 to talk to event viewer


I need to set up the microsoft application blocks 4.0 on the server and connect it to my web project.  I need to set it up so that all the errors are logged in the event viewer.  So far I have found out how to set up a flat file listener and send the error to a log file but, not to the event viewer.  Any suggestions would be helpful.

    Composite control: How to bubble a textbox's TextChanged event?


    I've created a composite control that contains several controls, including a textbox. I'm trying to expose the TextChanged event of the textbox as an event on the composite control. I understand that events can be bubbled up the control hierarchy and handled at a higher level, which I've attempted to do, but I can't get the bubbled event to fire. When I drop the control on an aspx I can see the TextChanged event, I can subscribe to the event, but nothing ever happens. Any suggestions? Here is what I think is the relevant code:

    // My event
    private static readonly object EventTextChanged = new object();

    //Handle the bubbled event
    EventHandler textChangedHandler = (EventHandler)Events[EventTextChanged];
    protected override bool OnBubbleEvent(object source, EventArgs e) 
        bool handled = false;

    Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


    how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


    Thanks in advance

    Creating Event Handler in Code behind


    Hi, so I have a control that is created in the code behind and generates fine but I can't figure out how to create an event handler for it.  I've found plenty of examples for it in C sharp, but none of them seem to apply to VB.  What I want to do is essentially this:

    myDropDownList.SelectedIndexChanged = "Event to do here"

    but it doesn't seem to work for me.

    Any suggestions are appreciated.

    Subscribing to .Net event from COM



    Can somebody tell me how to subscribe to .net event from the COM through interoperability?

    namespace EventSource
        public interface IBugEvents
            void Hungry();
            void Found(string item);
        public class Bug
            public delegate void HungryEventHandler();
            public delegate void FoundEventHandler(string item);
            public event HungryEventHandler Hungry;
            public event FoundEventHandler Found;

    Can somebody tell me how to Subscribe to the Hungry and Found events from the COM?If possible help me with COM Code.

    Event Tracing For Windows: Core Instrumentation Events in Windows 7, Part 2


    In Part 2, the authors cover core OS Event Tracing for Windows (ETW) events as well as present simple scripts to demonstrate a few basic accounting techniques on some of the OS events introduced.

    Alex Bendetov, Insung Park

    MSDN Magazine October 2009

    Event Tracing for Windows: Core Instrumentation Events in Windows 7


    In the first article of a two-part series, the authors present a high-level overview of the ETW technology and core OS instrumentation.

    Alex Bendetov, Insung Park

    MSDN Magazine September 2009

    Team System: Team Foundation Server Event Service


    Use the Team Foundation Server EventService to create and manage event subscriptions or create a Web service to receive and process events.

    Brian A. Randell

    MSDN Magazine May 2008

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend