If you look back on one of my previous posts on the UpdatePanel, you'll see that I cover a function called __doPostBack() located deep within the Atlas clientside framework. This is a very important method as it is not only the method that begins the partial postback sequence for Atlas controls, but also something that you can call yourself to programmatically cause a partial postback via javascript. __doPostBack() simply takes an eventTarget and eventArgument as parameters, detects if a partial postback is already occuring and, if not, sets appropriate form values (like _EVENTTARGET, _EVENTARGUMENT) that are used by the ASP.Net server runtime and then initiates a partial postback. The postback proceeds as if it were initiated by the eventArgument (which should be a reference to a HTML control on the page), like thus:
__doPostBack('<%= Button_Search.ClientID %>','');
If Button_Search's "Click" event were registered as a trigger for an UpdatePanel on your page, the UpdatePanel will refresh itself just as if you clicked the button manually (with your mouse). If you wanted to have an UpdatePanel that refreshed only programmatically, you could have a hidden button input field on your form and set it up as a trigger. The bottom line is that if you want to programmatically initiate a partial postback or to programmatically refresh and UpdatePanel, do so by calling __doPostBack().
Now, why would you want to do something like this? Under what circumstances would this be important? One instance that comes to mind immediately is having a child window refresh contents of a parent window, or to refresh contents of an UpdatePanel when a modal dialog closes, etc. All of these instances are not ones that are easily catchable from the Atlas framework alone, and so may require coding on your part. Many other situations probably exist out there.
For purposes of academia, here is the code for __doPostBack(); note that the rabbit hole of code contines at _onFormSubmit, but this is details you really ought to not care about in this situation:
this._doPostBack = function(eventTarget, eventArgument) {
_additionalInput = null;
if (this.get_inPostBack()) {
if (window.event) {
window.event.returnValue = false;
}
return;
}
_postbackSettings = null;
var postbackElement = findNearestElement(eventTarget);
if (postbackElement) {
_postbackSettings = getPostbackSettings(postbackElement);
}
else {
_postbackSettings = createPostbackSettings(true, _scriptManagerID);
}
if (!_postbackSettings.async) {
_originalDoPostBack(eventTarget, eventArgument);
return;
}
var form = _form;
form.__EVENTTARGET.value = eventTarget;
form.__EVENTARGUMENT.value = eventArgument;
this._onFormSubmit();
if (window.event) {
window.event.returnValue = false;
}
}