Whilst working with ASP.NET, sometimes we need to call server side methods asynchronously without having to postback whether it is full page postback
or a partial page postback. Thanks to the ASP.NET team for providing the implementation of
ICALLBACK is a lightweight process. It uses the well known XMLHTTP object internally to call a server side method, it doesn’t cause a page postback so doesn’t cause
page rendering, so we show the output at the client side. We need to make the output HTML ourselves and render the controls manually.
ICALLBACK is implemented in ASP.NET by using the
ICALLBACKEVENTHANDLER interface and it has two methods: one of them is used to call from
We just need to perform some action using server side code at the server side and return results, but results could be an instance or object
JSON is lightweight data-interchange format. ASP.NET gives good support for JSON as well. It’s rapidly being adopted because it is lightweight and easily
readable by humans and machines.
Callback Server Side Code
Let’s first implement
ICALLBACKEVENTHANDLER to call a server side method asynchronously step by step: