0

how can i disable a set of controls while waiting for a certain Ajax call to end?

I'm aware of the method:

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(onSubmit);

but this will be triggered for every updatepanel, not only the one I want to control.

Also, an UpdateProgress (maybe with an overlying semitransparent div) is not really disabling.

Maybe there's something in ajaxcontroltoolkit? Thanks

4

1 回答 1

1

此函数将在beginRequest事件上执行:


function onSubmit (sender, args) {
  var element = args.get_postBackElement();
  // May need more traversing...
  var parentElement = element.parentNode.parentNode;
  $(":input", parentElement).attr("disabled", "disabled");
}

这将禁用父元素内的所有控件。

请注意,您需要包含JQuery JavaScript 库。我想提一下微软支持 JQuery,他们将在即将发布的 Visual Studio 版本中支持它。欲了解更多信息,请访问http://live.visitmix.com/

于 2009-04-20T22:29:30.347 回答