Consider the following js code (to click an asp.net Button
on load):
function doSomething()
{
document.getElementById("<%= theButton.ClientID %>").click();
}
window.onload = doSomething;
When the page is loaded - the codebehind of the button is executed, and the page is loaded again (with new information). This should have introduced a bug of an infinite loop, but it doesn't. It is only called once, and ignored in the postback.
Why?