我想在我的asp.net页面中使用一个modalpopupextender来显示子表单。但它只能在具体条件下显示。这些条件由一段JavaScript代码确定。
所以,最重要的是,模态弹出窗口不必显示在按钮上。但是,如果我将属性TargetControlID为空我得到以下异常:
The TargetControlID of ‘ModalPopupExtender1’ is not valid. The value cannot be null or empty.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:
System.InvalidOperationException: The
TargetControlID of
‘ModalPopupExtender1’ is
not valid. The value cannot be null or
empty.
我只是将TargetControlID设置为隐藏的按钮,或者是有更加体面的选择吗?