How to specify javascript to run when ModalPopupExtender is shown

前端 未结 8 744
有刺的猬
有刺的猬 2020-12-28 13:15

The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn\'t seem to have an OnShowScri

8条回答
  •  情深已故
    2020-12-28 13:33

    var launch = false;
    
    function launchModal() {
        launch = true;
    }
    
    function pageLoad() {
        if (launch) {
              var ModalPedimento = $find('ModalPopupExtender_Pedimento');
              ModalPedimento.show();
              ModalPedimento.add_shown(SetFocus);
        }
    }
    
    function SetFocus() {
        $get('TriggerClientId').focus();
    }
    

提交回复
热议问题