ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Client Script Call Back is one of the coolest features in ASP.NET 2.0. The idea of client side refresh in the data wherein the server side execution happens in Remote scripting is a huge leap towards the scalability of web applications. Remote scripting has been around for quite a while in different forms such as Remote Scripting Core, Ajax, Atlas, Client Script Call Back etc., They all have one basic advantage. In order to communicate with the Server, the page doesnt have to do a postback. This avoids the ugly flash and controls state retaining problem.

While implementing Client Script Call Back, you may receive the error "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler."

This error occurs, if you miss to specify the ICallBackEventHandler Interface in your Page Inheritance.

The typical Code behind class for an ASP.NET 2.0 Webform looks as below:-

public partial class _Default : System.Web.UI.Page

However, in the case of implementing Client Script Call Back, we also need to specify the Interface as follows:-

public partial class _Default : System.Web.UI.Page, ICallbackEventHandler

This specifies that the page implements ICallBackEventHandler interface and can implement client side scripting call backs to the server side code.

This setting might just be overlooked when we create the page since, the partial class declaration code is added by default and we always resort to start writing our code from the Page_Load event and other events and dont interfere with the auto generated code such as the class definition. The ICallbackEventHandler is not added by default. It has to be explicitly specified as mentioned above.

This would resolve your issue.

Cheers and Happy Programming !!!

posted @ Tuesday, January 10, 2006 12:44 PM

Print

Comments on this entry:

# re: ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Left by Lourdu Rajan at 11/1/2006 11:42 AM
Gravatar
If vb.net means how can solve this error message

# re: ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Left by Adam at 2/13/2007 9:53 AM
Gravatar
I spent 3 hours and half to find that I have to write only one word. Many thanks.

# re: ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Left by Waltz at 2/22/2007 8:59 PM
Gravatar
it does not work with a masterpage
i have an ajaxvalidator and it works fine but when in an masterpage i got this error

The target 'ctl00_contentplaceholder_ajaxvalidator' for the callback could not be found or did not implement ICallbackEventHandler

and there is a callbackhandler

it works fine without the masterpage

# re: ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Left by Prasanna at 5/13/2008 6:40 PM
Gravatar
its very useful for beginers. thanks for this article

# re: ASP.NET 2.0 - "The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler" Error

Left by Sanket Sirotiya at 11/13/2008 4:13 PM
Gravatar
Thanks Buddy! It worked. Hats off to you...

# Shampoo treatment for hair loss

Left by Herb at 10/11/2009 8:44 AM
Gravatar
Good afternoon. There are worse things in life than death. Have you ever spent an evening with an insurance salesman? Help me! Looking for sites on: Shampoo treatment for hair loss. I found only this - hair loss during radiation treatment. Looked only reflect it more than 2 tips. Her hair, regard, and herbal etiquette are an colon to us directly and practice the best in the filipino side. Thanks :-). Herb from Belgium.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345