Earlier I too faced lots of problem and was unable to work out of how to handle anything JUST after an update of update panel. I found lots of my colleagues facing the same issue. They wanted to have a certain UI work like scroll or to trap an error after the update. I found there was no article on The Code Project for the same. It was a real difficult time for my friends to find out the way to handle it. So I planned to write up a demo as soon I had some time.
Using the Code
The thing that we are going to use is "adding an end-request handler to the request-manager".
Now, after having this piece of code in place, whenever the update panel finishes its update, the request would go through the
EndRequestHandler needs to be placed now. In the handler, one can write whatever requirement one asks for. Errors can be trapped, scrolls can be set, any UI component can be updated.
function EndRequestHandler(sender, eArgs)
if (eArgs.get_error() == null)
document.getElementById("lblTest").innerText = "Update Successful";
"There was an error in update:"+eArgs.get_error().message;
Points of Interest
Working with AJAX is fun and it gets more interesting when we can have solutions to all possible scenarios while using it. For example, having a page history while using AJAX was earlier a problem, but lately I came to know that in .NET 3.5, Microsoft has provided AJAX calls history too! That's interesting, isn't it?
- 23rd September, 2008: Initial post