开发者

modalpopupextender set to multiple target control IDs?

Is it possible to tie one modalpopupextender t开发者_开发技巧o multiple target controls (multiple buttons)?

Thanks Behrouz


Good Answer, I will just add to it:

  1. For me I had to change onclick to OnClientClick:

    <asp:Button ID="btn_contact2" runat="server" 
                OnClientClick="javascript:$find('popup1').show();return false;" 
                Text="Possibilites" />
    
  2. You need to add a BehaviorID to the modalpopup:

    BehaviorID="popup1"
    


I don't think you can specify multiple targets for the ModalPopupExtender. But you can call it from other controls via JavaScript by adding something like this to their onclick handler:

<act:ModalPopupExtender id="mpePopup" runat="server" BehaviorID="bePopup" ... />
<asp:Button id="btnOther" runat="server" Text="Open Dialog" OnClientClick="$find('bePopup').show();return false;" />

The key is to provide a value for "BehaviorID" in the extender control. This enables client-side access via the "$find(behaviorID)" method, from which you can ".show()" or ".hide()" the modal popup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜