Thursday, November 15, 2007

 

Clicking and Gambling

As Mose Allison might have said, clicking can be a risky business. Especially when you click() on an ASP.NET 2.0 Button control. See "Check, set, click, whirr," May 26, 2007.

Internet Explorer 6.0 will crash and burn if you do that inside the handler for an 'onclick' event. So tarry a bit, and keep customers happy. Just timeout:

    window.setTimeout(ClickButton, 50);

function ClickButton()
{
    var oButton =
     document.getElementById('<~% = ofButton.ClientID %~>');
    if (oButton != null)
         oButton.click();
}

[Note: because of display limitations, characters "< " and " >" here are shown with a tilde ~ after or before them.]

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]