.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

Executing a callback method when the asynchronous operation returns

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Windows Application

Hi, I really don't understand the physical meaning of "callback" in the real world although a lot of code there. Can somebody give me a real world example to explain it?(not code itself)?

Thank you very much.

View Complete Post

More Related Resource Links

.NET Delegates: Making Asynchronous Method Calls in the .NET Environment


One of the many great features of the .NET Framework is that it has asynchronous infrastructure built in. In .NET you can call any method asynchronously by defining a delegate for the method and calling the delegate's asynchronous methods. This is beneficial to your application because when a synchronous call is made, the calling thread is blocked until the method completes whereas an asynchronous call is made on a different thread, and this allows the original thread to continue its work while the asynchronous call is in progress.This article explains delegates in .NET and how to use them to perform asynchronous calls, eliminating age-old threading problems.

Richard Grimes

MSDN Magazine August 2001

Windows 2000: Asynchronous Method Calls Eliminate the Wait for COM Clients and Servers


Windows 2000 is the first version of COM to support asynchronous method calls, which permit clients to make nonblocking calls to COM objects and objects to process incoming calls without blocking the calling threads. COM clients benefit from asynchronous method calls because they can continue working while waiting for outbound calls to return. Objects benefit because they can queue incoming calls and service them from a thread pool. Our SieveClient and SieveServer sample apps demonstrate how to create and use asynchronous clients and servers in COM-based distributed applications.

Jeff Prosise

MSDN Magazine April 2000

Is there a method that returns the control's type, such as "TextBox", "TextBlock", "Canvas", etc.,

Hello, I have a method that is passed in a FrameworkElement Ctrl.  When I use Ctrl.GetType().ToString() I get "System.Window.Controls.TextBox" or another string if a different type of control is passed in.  All I am interested in is the text after the last dot/period.  In my searching I thought I came across something that just returned the portion I'm looking for, but now can't find it. Is there a method that returns the control's type, such as "TextBox", "TextBlock", "Canvas", etc., without its parents? Regards, Robert

Infinite timeout for callback operation

I am using a callback contract to pull messages from an external service. Apparently messages could received could be received at irregular intervals. I am having an issue where my service is timing out, I believe this is because if there is no callback for a while (I guess 10 minutes by default). Is there a way to set idle timeout to infinite? Is it recommended to set it to infinite or is there a better approach.-= JL =-

The method or operation not implemented.

Hi Team, I am trying to create a plugin for database project. I created a context menu item for database project to identify the name and full path of the "Database" project to read the script files through my code. While finding the avilable projects in solution file, i am able to find the name of the database project, but i am not able to find the full path of the database project. Could you please help me out on this.... Thanks & Regards, Nagaarju Rage|MS DotNet Developer              

Provide object over network on callback method

Hello. I am building a client server video monitoring system. I will have a user (viewer) connect to a web page on a server, pick a camera and see what is going on at the particular location. A general WCF question: How can I access VideoSource custom class object remotely on the server via WCF? Basically, I have a VideoSource and VideoSourcePlayer that work great, when are within one process, but how can I access VideoSource object remotely? An example link would be enough. Thank you.  Max Pavlov http://maxpavlov.com

Problem canceling asynchronous method



I want to canceling an asynchronous method.

How can me it?


public IAsyncResult BeginGetAllUsersCount(object sender, EventArgs args, AsyncCallback callback, object state)
       //Canceling asynchronous operation
     return AdapterUser.BeginGetAllUsersCount(callback);

   public void EndGetAllUsersCount(IAsyncResult asyncResult)
     _totalRowsCount = AdapterUser.EndGetAllUsersCount(asyncResult);




GetUserProfileByName method in userprofileservice.asmx returns null values when used in Service Refe


I'm using Silverlight 4 to call GetUserProfileByName method of the SharePoint 2007 userprofileservice.asmx web service. For each of the PropertyData in the e.Result object that is returned, the Values array is null.

Below is the Completed event handler. Execution gets inside the if block for each of the PropertyData.


void client_GetUserProfileByNameCompleted(object sender, GetUserProfileByNameCompletedEventArgs e)
 foreach (PropertyData prop in e.Result)
  if (prop.Values == null) // this is ALWAYS true for each prop


After some investigation, I've found out this only happens when userprofileservice.asmx is added as a Service Reference. I tested this out by creating an ASP.NET project. In it I added userprofileservice.asmx as a Web Reference, and then as a Service Reference. For the Web Reference case,

Executing method of the Generic class using Reflection.



I have a generic class:

 abstract public class BaseTC<T>:IExecutable where T : Core, new()
    private Type2 testInfo;
    private Type1 settings;
    private T core = null;

and I want to load such class from library the class is located in, and create an instance of it and execute methods later on.

I know how to use non-generic classes, but no idea how to call the same with generics.

Web Service - Different Operation Contracts calling the same method

I would like to know how could I define two operation contracts (JSON, XML) which call to the same method; I have defined web and basic http bindings for all the Operation Contracts in the way that they could be called from HTTP requests (jQuery) and from Silverlight.

This first example works because the methods have different number of input parameters. But I need to add the attribute name to the Operation Contract.

        [WebInvoke(Method = "POST",
            UriTemplate = "1/json/getRegions",
            ResponseFormat = WebMessageFormat.Json)]
        RegionListOutput GetRegionList(int countryID, int other);

        [OperationContract(Name = "getRegionsXML")]
        [WebInvoke(Method = "POST",
            UriTemplate = "1/xml/getRegions",
            ResponseFormat = WebMessageFormat.Xml)]
        RegionListOutput GetRegionList(int countryID);


The method or operation is not implemented error



I have a method which i used to retrieve information from the database. I've tested it on my side and i encounter no problem. However, when i transfer over the method to a new version, the above error was thrown out. Can someone help me regarding this problem?

The method used is as below:

public DeviceConfiguration getDeviceDetails(string deviceId)
            DeviceConfiguration device = new DeviceConfiguration();
            device = BCViewEditDevices.Current.GetDeviceById(deviceId);

            return device;

The error is pointing at return device.


Webservice versions.asmx: Getversions-method returns error on an item of a custom list.


I using GetVersions from the webservice http://server/_vti_bin/versions.asmx. This method works Okay in SharePoint 2007, and in SharePoint 2010 it also works Okay on documents from a document library. But when I used on an item from a custom list, it returns an error stating: "Value cannot be null.\r\nParameter name: key". In SharePoint 2007 I could retrieve the histroy on an item with the call GetVersions("Lists/MyCustomList/5_.000"), in SharePoint 2010 this fails.

Do I need to change the parameter, or use another filename for an item instead of "5_.000"? Does any one have the same experience?

Thank you

WSS3] Deployment error with central admin or stsadm : The method or operation is not implemented

I created under WSS3 / VS2010 a WSPBuilder solution that activat a feature.
All is ok when i deploy via the "Deploy" of WSPBuilder under VS2010.
But when I do the deployment with central admin or stsadm i have an error : "The method or operation is not implemented."

Do you have any idea please ?

SVCUtil changing CallBack interface method


I am creating a WCF duplex callBack structure, with a WPF app registering with a WCF service, and the WCF service using a CallBack in the WPF app to pass data from time to time. The interface for the callback in WCF is simple:

  void DataUpdate(string updatedData)

yet when I launch the service and run SVCUtil.exe, the CS code changes the callBack interface to

  void DataUpdate(DataUpdate request)

What is the cause of this? How can I get the proper structure to show in the SVCUtil output?



Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.
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