Technology

Call a CallBack method when asynchronously Call completes in Asp.net Part IV

In Previous articles, we established a result that one delegate function which wrapped a function to call asynchronously. Now there will be another asynchronous function which calls when asynchronous function completes its execution just like another asynchronous function. In Callback function you can process result or call EndInvoke methods or any other action to perform after asynchronous call.

In this pattern, you must pass the callback delegate to BeginInvoke as a parameter. Thread initiates the asynchronous call but doesn’t wait like other pattern. After asynchronous call complete, it calls Callback function to process result and call endInvoke function. Let’s see an example.

CallbackPattern

Result:

CallbackPatternResult

Download (RAR, 577B)

Author

Inaam Ur Rehman

Inaam ur Rehman is a Senior Software Engineer in Allied Consultants. With a experience over 3 years in ASP.Net, SharePoint, BizTalk, Java Script and JQuery . He is one of the key resources of ASP.Net for the organization.