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

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

ManagementClass, ManagementOperationObserver - Process is not firing Completed Event.

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :.NET Framework
I need to execute a command on Remote box and the task is to wait till the execution finishes and then need to do some other steps. i have written following code using ManagementClass and ManagementOperationObserver  (for Asynchrous execution), it is working fine with win 2003 boxes but when i execute it on 64-bit it is hanging. ALthough my command got executed it is not able to fire the event Completed(observer Delegate). Appreciate any quick help. here goes my code

Class someClass{



bool _wait = false;

void somefunction()

View Complete Post

More Related Resource Links

MouseUp event not firing on ActivityDesigner class?

I have a custom control derived from ActivityDesigner.  I'm basically retemplating the contol to give it a stylized look and feel ... I want to add the ability to change the Display Name by swapping out the TextBlock with a TextBox on MouseUP - but this event is not firing. I can handle the MouseDown event and it works OK, except it enters the Edit mode when dragging the activity around.  Is the MouseUp handled at the base level?  Is there a way to work around this? 

Disable Login event firing in SP 2007

hello, how can i disable the login event firing in sharepoint ?...i just want to disable the sign in event 

Sharepoint Event Handler not firing

I have written an event handler for an ItemAdded eventfor a document library. I am trying to read an excel file being uploaded and extract a value from it which I write to a list column for the item. I have this working properly on my development machine which is a Windows Server 2003 machine.However, on a production Windows Server 2008 machine, the event handler never fires. I am doing a simple write to a log file to test and see if it runs at all even if the Excel parsing does not work but I get no indication that it ran. The event handler is being registered with a feature that I am deploying. I have verified that the event handler is registered to the library by using the u2u Event Handler Explorer tool.Is there any way I can determine if my event handlers are even executing? How can I debug this?

ItemAdded Event Handler not firing

Hi, I have created an ItemAdded Event handler that is linked to a content type. This event handler does certain custom validations and then sends Email to users. I have referenced this event handler in XML file as well but somehow the event handler is not getting fired...Following is the code.   Code Snippet            this.DisableEventFiring();            using (SPSite site = new SPSite(properties.SiteId))            {                 using (SPWeb web = site.OpenWeb())                {                    base.ItemAdding(properties);                     SPList nList = web.Lists["NList"];                    SPList IList = web.Lists["IList"];                     foreach (SPListItem listItem in nList.Items)                    {                        if (listItem["Topic"].ToString() == properties.ListItem["Topic"].ToString())                        {                            SPUser alertUser = (SPUser)(properties.ListItem["SUser"]);                            SPUtility.SendEmail(web, false, true,alertUser.Email,"New item added", "A new item has been added");                         }                    }                    this.EnableEventFiring();                }            }       The XML file is: Code Snippet  <XmlDocuments>      <XmlDocument NamespaceURI="http://schemas.microsoft.com/

click event only firing for lower 100 pixel portion of vertical div

 I have a div on the left side of my page. when clicked I toggle a hidden div that flies out to the right. But the click event only works on the bottom portion of the div. The hidden div has a close button div in the lower right. to clicks fine. any ideas? code is below jquery <script type='text/javascript'> $(document).ready(function() { var $scrollingDiv = $("#divReportBanner"); $(window).scroll(function(){ $scrollingDiv .stop() .animate({"top": ($(window).scrollTop()) + "px"}, "fast" ); }); $('.toggle-button').click(function() { $("#divLeftMenuBody").animate({width:'toggle'},400); }); $('#divReportBanner').click(function() { $("#divLeftMenuBody").animate({width:'toggle'},400); }); }); </script> html <div id="divReportBanner" ></div> <div id="divLeftMenuBody" runat="server"> <div style=" overflow: scroll; overflow-x:hidden;width:365px; height:370px;">

On click Dialog Box to browse file...NOt firing serverside event...

<script type="text/javascript">    function Open()    {         var fileupload=document.getElementById('fupload');                      fileupload.click();  //       document.form1.submit();    }       </script>protected void Page_Load(object sender, EventArgs e)    {btnimport.Attributes.Add("onclick", "javascript:return Open();");    }<asp:Button ID="btnimport" OnClick="btnimport_onclick" runat="server" Text="Import"/>                                                        <input type="file" runat="server" style="display: none" id="fupload" />protected void btnimport_onclick(object sender, EventArgs e)    {        if (ViewState["CurrentTable"] != nu

List Event Receivers firing for all custom lists

Hello, I have a site with two custom lists, and I have created an EventReceiver class to handle the ItemAdded event for custom lists. I have modified the EventReceiver's Elements.xml file to only handle items added to one of the custom lists instead of all custom lists, by changing: <Receivers ListTemplateId="100"> to <Receivers ListUrl="/Lists/MyCustomList">   however, when debugging, the ItemAdded method is being fired when an item is added in both custom lists. I have had to work around this by checking within the ItemAdded method for the list that fired the event:        public override void ItemAdded(SPItemEventProperties properties)        {            base.ItemAdded(properties);            if (properties.ListTitle.Equals("My Custom List")) { ... } I thought the ListUrl attribute of the Receivers element specifies the event to only fire for the specific list with that url? (see http://msdn.microsoft.com/en-us/library/ms431081.aspx). Is there somewhere else I should be checking?   Thanks

Background worker - errors in completed event

Create a new windows forms project (in using vb.net 2010). Create a button and a background worker on the form. Under the Debug > Exceptions menu, make sure that for 'Common Language Runtime Exceptions' you have 'Thrown' unticked and 'User-unhandled' ticked. Now put the following code in the form's code-behind; Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click BackgroundWorker1.RunWorkerAsync() End Sub Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork Threading.Thread.Sleep(2000) End Sub Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted Dim X As Integer X = 5 / X End Sub End Class Why does it not error nicely? It comes up with no helpful stack trace and just says 'Exception has been thrown by the target of an invocation.'. Place the code to cause the error into the Button_Click event and run it and you will see the difference. Why do we not get these 'nice' errors given that the runworkercompleted event is supposed to be running on the main thread?

'Completed' is not an event of 'System.Activities.WorkflowApplication'

Hello,I have a C# code which i have converted into VB.But i am getting compile error in VB code:'Completed' is not an event of 'System.Activities.WorkflowApplication'find below C# and VB code:C#:application.Completed += delegate(WorkflowApplicationCompletedEventArgs e){completedEvent.Set();};VB : AddHandler PickSample.application.Completed, Sub(e As WorkflowApplicationCompletedEventArgs) completedEvent.Set()Can some one provide me solution ?

Drop Down Listbox SelectedIndexChanged Event not firing when I programmatically change selection

I have two drop down listboxes (DDL1 and DDL2).  When DDL1 has an index change, DDL2 then has a refresh of list items based off SQL Server SELECT from a table.  The database isn't the problem.  Everything works perfectly when the user selects a new item manually from DDL1.But in my code, I save the user data from the selection of DDL1 in a separate table.  And then upon rendering of the page (Page_PreRenderComplete), I do a SelectedIndex assignment of the value of what's saved in the db table.  That works just fine, it selects the DDL1 item, but DDL2 is unaffected, as if DDL1's SelectedIndexChanged event isn't called like it would be if manually changed.  How can I get around this?Thanks in advance. :)

ProcessCmdKey event not firing

I have a fairly involved form that is composed of a lot of telerik controls and also has a ChartDirector chart in it.  I am trying to manipulate a cursor in the chart that will skip from one point to another, and I want to use the arrow keys as one method to move the cursor. I have overridden the ProcessCmdKey event in the Form class that hosts all the controls, and it never fires in my application (I put in break points to be sure).  I have tested the exact same code in a newly created RadForms object that also included similar controls (though not as extensive), and it works just fine.  My conclusion is that there is another event that gets fired first and is intercepting the information before ProcessCmdKey sees it. Is this a reasonable assumption, and if so, does anyone know which event might be being fired and know of a way to check what it's doing?  This single form has a few thousand lines of code, and a truckload of event handlers, so excising them one by one will be time consuming. thanks, David

Event ID 1011 Process ID 556

Server is running Windows 2003 Standard Edition, SP2.  When we attempt to click on the URL that hosts the program running on this server we receive Page cannot be displayed and the below message appears in the Sytem Event Viewer immediately.  The software running is a few years old so not sure if .net caused this error.  Any ideas? Event Type: Warning Event Source: W3SVC Event Category: None Event ID: 1011 Date:  9/14/2010 Time:  10:44:59 AM User:  N/A Computer: NOVATIME Description: A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '556'. The data field contains the error number. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: 6d 00 07 80               m..?   

KeyDown event on a Form is not firing for STX and/or ETX

I'm using a wireless barcode reader that's inputting data using HID. I've configured it to wrap the output between STX and ETX (0x02, 0x03), however, i never get any KeyDown event generated when those keys are sent from the device, the barcode keys are sent just fine but not STX and ETX.

FormView Command Button not firing Item Command Event

Hi, In my content page, I have a formview for Insert & Edit. In insertitemtempalteI have a command button (btnInsert) to trigger  Item_Command event to insert a new record. The button event never gets triggered. But If I set CausesValidation = "false"it fires. But I want the validation to take place. I tried btnInsert_command and btnInsert_Click events. None of them is fired. Ideally I would like to havethe item_command event fired. I would appreciate any inpyt on how to handle this problem. <FormView>     <InsertItemTemplate>            .....           <div>               <asp:Button id="btnInsert" CommandName="Insert" Text="Insert" runat="server" UseSubmitBehavior="true" />              <asp:Button id="btnCancel" CommandName="Cancel" Text="Insert" runat="server" />           </div>     </InsertItemTemplate></FormView>   Thanks Suresh

dynamically created button control click event not firing first time?

HI im creating a button control in page int and im assing a click event for the button control. here the click event is not firing for the first time.can anyone help me with this? here is my code. Button btn = new Button(); btn.ID = "btn"; btn.Click += new EventHandler(btn_Click); Panel1.Controls.Add(btn); Panel1.Controls.Add(new LiteralControl(""));

Connect InfoMessage event is not firing

I'm not able to fire the SQL Connection’s InfoMessage event - here's the code that I've set up The normal message that i'd expect to see in mSQLMessage is "(12 row(s) affected)"  but the mConnect.InfoMessage is not firing.  Any ideas what I'm missing? Public Class Dispatch     Private WithEvents mConnect As SqlConnection         Private Sub SaveSQLMessages(ByVal sender As Object, ByVal e As SqlClient.SqlInfoMessageEventArgs) Handles mConnect.InfoMessage         mSQLMessage &= e.Message & vbNewLine     End Sub     Public Function GetDatatableofJobs() As DataTable         Dim ds As New DataSet         mConnect = New SqlConnection         mConnect.ConnectionString = mStrConnect         Try             mConnect.Open()             Dim da As New SqlDataAdapter("Select * from dbo.vGetPriceItJobs", mConnect)             da.Fill(ds, "Jobs")         Catch ex As Exception   &nbs

URL Routing + PostBack not firing BeginRequest event


hi all,

we are having some weird issues with URL Routing in ASP.NET 3.5. 

We have a search box that does a search and redirects to a routed URL.

 When we search for the first time (aka Press a button that forces a postback) everythign works as expected.  we get:

1. BeginRequest event.

2. Determines Route

3. Calls Routehandler to match the route item to the actual destination page

4. Routes the url appropriately.

After you do one search successfully and try again it fails to call the BeginRequest event.  Because of this the routing data never gets called and so the url is never routed to its correct destination.   What is weirder still if we append a "/" (trailing slash) to the url after the initial postback it DOES work properly again. 

So our search route looks like this


entering a term and pressing the SEARCH button would yield a result url like this:



Going back (after 1 successful search) you then need to use this url or else BeginRequest will never fire:

mydomain.com/Search/ < (note the extra "/" at the end)


Anyone have an idea a

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