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 !!!

Print | posted on Tuesday, January 10, 2006 12:44 PM

Comments on this post

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

Requesting Gravatar...
If vb.net means how can solve this error message
Left by Lourdu Rajan on Nov 01, 2006 11:42 AM

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

Requesting Gravatar...
I spent 3 hours and half to find that I have to write only one word. Many thanks.
Left by Adam on Feb 13, 2007 9:53 AM

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

Requesting 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
Left by Waltz on Feb 22, 2007 8:59 PM

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

Requesting Gravatar...
its very useful for beginers. thanks for this article
Left by Prasanna on May 13, 2008 6:40 PM

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

Requesting Gravatar...
Thanks Buddy! It worked. Hats off to you...
Left by Sanket Sirotiya on Nov 13, 2008 4:13 PM

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

Requesting Gravatar...
Thanks. It worked for me.
Left by PurnimaK on Jan 04, 2010 4:26 PM

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

Requesting Gravatar...
You're a star bro..
Left by Jiby Matthews on Jan 19, 2010 7:15 AM

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

Requesting Gravatar...
A great help for figuring out that Client Script Call Back related error, thanks a bunch.
Left by World Cup on Jun 07, 2010 8:50 PM

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

Requesting Gravatar...
tnx tat was very helpfull
Left by Santosh on Aug 17, 2010 11:13 AM

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

Requesting Gravatar...
Not implementing this Interface is not the only cause this error occurs.
Im getting this error but I definitely implemented the interface.
Left by Chris on Apr 17, 2013 1:43 PM

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

Requesting Gravatar...
Its worked for me. Thanks alot
Left by Diwakar Singh Chauhan on Feb 13, 2015 2:16 PM

Your comment:

 (will show your gravatar)