As far as I'm aware, there isn't a way to truly disable the popup, other then using the $clearHandlers[^] method on the button itself. The downside to this is that you'd have to do it on any postback operation (including an async postback run through an UpdatePanel). Detaching the event also suffers from a bit of tricky timing in a postback scenario, as you're in a race with the modal extender trying to attach the event. The ModalPopupExtender
does have a client-side API which exposes a showing
event that can be trapped, and cancelled. This will allow you to stop the popup from showing itself, although, the event will still be triggered on each click of the button. For example, the following was my quick prototype:
var loadInitialization = function()
{
var extender = $find('MyExtenderBehaviorId');
var handler = Function.createDelegate(extender, function(sender, args) { args.set_cancel(true); });
extender.add_showing(handler);
}
Sys.Application.add_load(loadInitialization);
My apologies for the poor formatting, but CopyTextAsHTML doesn't work for code-in-front. Hope that helps. :)
--Jesse
"... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi